#38048 [Opn->Bgs]: $_SESSION cannot be changed after copying it into another array
| From: | tony2001@php.net | Date: | Sun, 09 Jul 2006 17:14:38 +0000 |
| Subject: | #38048 [Opn->Bgs]: $_SESSION cannot be changed after copying it into another array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99253@lists.php.net to get a copy of this message | ||
ID: 38048
Updated by: tony2001@php.net
Reported By: seitenzahl at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: Windows XP
PHP Version: 5.1.4
New Comment:
See bug #37926.
Previous Comments:
------------------------------------------------------------------------
[2006-07-09 15:25:30] seitenzahl at hotmail dot com
Fixed a typo in the summary.
------------------------------------------------------------------------
[2006-07-09 15:03:34] seitenzahl at hotmail dot com
Description:
------------
After doing something like
$oldsessiondata = $_SESSION;
the changes to $_SESSION won't be committed to the session itself
anymore.
I don't think $_SESSION should lose its magic properties in this case.
Reproduce code:
---------------
<?php
session_start();
$_SESSION['testbefore'] = 'foobefore';
print_r($_SESSION);
$oldsessiondata = $_SESSION;
print_r($_SESSION);
$_SESSION['test'] = 'foo';
print_r($_SESSION);
?>
Expected result:
----------------
Array
(
[testbefore] => foobefore
)
Array
(
[testbefore] => foobefore
)
Array
(
[testbefore] => foobefore
[test] => foo
)
After reload:
Array
(
[testbefore] => foobefore
[test] => foo
)
Array
(
[testbefore] => foobefore
[test] => foo
)
Array
(
[testbefore] => foobefore
[test] => foo
)
Actual result:
--------------
Array
(
[testbefore] => foobefore
)
Array
(
[testbefore] => foobefore
)
Array
(
[testbefore] => foobefore
[test] => foo
)
After reload:
Array
(
[testbefore] => foobefore
)
Array
(
[testbefore] => foobefore
)
Array
(
[testbefore] => foobefore
[test] => foo
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38048&edit=1