ID: 40274
User updated by: ben at vanilla dot net
-Summary: Sessions fail with numeric string root keys
Reported By: ben at vanilla dot net
Status: Open
Bug Type: *Web Server problem
Operating System: FreeBSD 6.2
PHP Version: 5.2.0
New Comment:
Juts noticed this is the same with numeric strings and
ordinary numeric keys.
Previous Comments:
------------------------------------------------------------------------
[2007-01-29 13:40:28] ben at vanilla dot net
Description:
------------
If you set a session variable with the root key as a numeric
string it fails to save. It also fails to save anything else
in the array after the numeric rook key string.
This was via FCGI with lighttpd, but also reproduced on Debian
etch with apache2.
Reproduce code:
---------------
Set a session :-
<?php
session_start();
$_SESSION['Test1'] = "This should be ok";
$_SESSION['123']['test']="This is a test";
$_SESSION['Test2'] = "This is not saved";
?>
<PRE>
Session Set:
<?php print_r($_SESSION); ?>
</PRE>
Read it :-
<?php
session_start();
?>
<PRE>
Session Read:
<?php print_r($_SESSION); ?>
</PRE>
Expected result:
----------------
I would expect to see the same details in the session from the
second piece of code as output from the first. :-
Session Read:
Array
(
[Test1] => This should be ok
[123] => Array
(
[test] => This is a test
)
[Test2] => This is not saved
)
Actual result:
--------------
Session Read:
Array
(
[Test1] => This should be ok
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40274&edit=1