|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-25 12:33 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 05:00:01 2025 UTC |
Description: ------------ My apologies if this is a dup, I've searched and searched and found nothing. php.ini [relevant]: session.save_handler = files session.save_path = /tmp session.use_cookies = 1 session.use_only_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php As commented in the code, the $_SESSION variable is not correctly set when both $array[1] and $array['string'] are set. Reproduce code: --------------- <?php session_start(); //this is our goal, to get here. if(isset($_SESSION['allSet'])){ print_r($_SESSION); session_destroy(); } //start the test. else{ /* this numeric key creates the problem. commented out "$basic_array[0] = 4;" and this code will work fine, otherwise we have an infinite redirect. */ $basic_array[1] = 4; $basic_array['user_id'] = 4; $basic_array['email'] = "rob@rob.com"; foreach(array_keys($basic_array) AS $key){ $_SESSION[$key] = $basic_array[$key]; } $_SESSION['allSet'] = 1; header("Location: http://FULLPATHTOSERVER/LOGINTEST.php"); } Expected result: ---------------- The $_SESSION variable should contain all the relevant data. Actual result: -------------- $_SESSION contains no data, despite being set.