#22245 [Csd]: Unserialize Problem with References
| From: | goth at php-resource dot de | Date: | Mon, 11 Aug 2003 19:41:00 +0000 |
| Subject: | #22245 [Csd]: Unserialize Problem with References | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-45753@lists.php.net to get a copy of this message | ||
ID: 22245
User updated by: goth at php-resource dot de
Reported By: goth at php-resource dot de
Status: Closed
Bug Type: Session related
Operating System: *
PHP Version: 4.3.3RC2-dev, 5.0.0b2-dev
Assigned To: sas
New Comment:
@Sniper: I never thought you're dumb ... but maybe as arrogant as I am
... ;)
Previous Comments:
------------------------------------------------------------------------
[2003-08-11 14:21:26] iliaa@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2003-07-12 23:34:04] sniper@php.net
Even as you think I'm arrogant and dumb, I'm marking this as verified.
(In hope you really get a heart-attack..>:)
Here's a complete test case script:
<?php
session_start();
if (isset($_GET['destroy'])) {
session_destroy();
header("Location: {$_SERVER['PHP_SELF']}");
exit();
}
echo "register_globals: ", ((ini_get('register_globals')) ? 'On' :
'Off'), "<br />";
if (!isset($_SESSION["A"]) && !isset($_SESSION["B"])) {
$_SESSION["A"]=10;
$_SESSION["B"]=&$_SESSION["A"];
}
echo "BEFORE: A=".$_SESSION["A"]."<br />";
echo "BEFORE: B=".$_SESSION["B"]."<br />";
$_SESSION["A"]++;
echo "AFTER: A=".$_SESSION["A"]."<br />";
echo "AFTER: B=".$_SESSION["B"]."<br />";
echo "<br /><a href='{$_SERVER['PHP_SELF']}?destroy=1'>destroy
session</a> after changing register_globals setting to see the bug in
effect";
echo "<br />(and reload the page couple of times..)";
?>
When register_globals = On -> Works.
When register_globals = Off -> Does not work.
------------------------------------------------------------------------
[2003-05-26 21:55:27] gschine at middlebury dot edu
we have had extensive experience with this, and it
seems that the above bug only occurs while
register_globals is OFF. when it's on everything works
as expected.
------------------------------------------------------------------------
[2003-05-20 17:53:40] goth at php-resource dot de
Yes I am very sure that php4-STABLE-200302071830 worked properly with
the stated code above ... !
Another Question ... what does R:1 mean in this serialization??
A|i:10;B|R:1;
------------------------------------------------------------------------
[2003-05-20 17:38:00] sas@php.net
Not reproducible. I tried this with 4.2.3, 4.3.1 and current 4_3 CVS.
The references between $_SESSION entries are never reestablished.
Additionally, I tried a cvs checkout -r PHP_4_3_0 -D 2/7/2003 with the
same negative result.
So, are you absolutely sure that you have some code where this works?
Did you use register_globals = on?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22245
--
Edit this bug report at http://bugs.php.net/?id=22245&edit=1