#23689 [Opn->Bgs]: serializing - deserializing session data doesn't work
| From: | sniper@php.net | Date: | Sun, 18 May 2003 22:42:06 +0000 |
| Subject: | #23689 [Opn->Bgs]: serializing - deserializing session data doesn't work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39916@lists.php.net to get a copy of this message | ||
ID: 23689
Updated by: sniper@php.net
Reported By: marty at excudo dot net
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: linux
PHP Version: 4.3.1
New Comment:
Don't serialize $_SESSION...or any other of those superglobal variables
either. Not bug.
Previous Comments:
------------------------------------------------------------------------
[2003-05-18 17:32:07] marty at excudo dot net
For an intranet application i wrote a function that can store the
current position/page, by serializing the $_GET, $_POST and $_SESSION
data and storing them, along with the url, in the database (except for
session information that contains login-information of course).
This is when i found out, that when you retrieve the serialized session
data from the database, then deserialize it and put it back into the
session (having unset() it first of course), php starts to mess up.
Initially, the data you stored will be placed back into the session (a
print_r() reveals this) and everything seems fine. But as soon as you
navigate away from the page, suddenly the session data gets overwritten
with the data from before the restoration procedure. (which is even
more strange cause it had been unset()!).
I created an example that you can try out for yourself
http://www.marinesofficers.com/test/example.html
that page contains screenshots, that explain once again what happens,
in detail, and a link so you can actually go through the steps
yourself.
The bug showed on a server with PHP version 4.3.1 and i've tested it on
two other servers (with a slightly lower version) as well. Same
results.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23689&edit=1