note 27125 deleted from ref.session by sniper
| From: | sniper@php.net | Date: | Tue, 21 Jan 2003 03:13:11 +0000 |
| Subject: | note 27125 deleted from ref.session by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-42469@lists.php.net to get a copy of this message | ||
I just noticed a strange behavior with php sessions.
With register_globals = off I am using the $_SESSION array to capture and retrieve my session
variables.
When I have a variable in my script with the same name as an index in the $_SESSION array...
$foo = "bar1";
$_SESSION["foo"] = "bar2";
I've noticed that at the end of the script, sessions first tries to write the contents of the
$_SESSION array.
unset( $_SESSION["foo"] );
If for some reason I unset the session variable "foo" from the $_SESSION array, sessions
will then try to write the contents of $foo.
... next script that calls session sees...
$_SESSION["foo"] = "bar1"
This is bizzare. I already have a headache from this one. Hope this helps other people with their
session problems!