Re: Re: Sessions / Serialized Data

From: Date: Wed, 17 Apr 2002 18:36:55 +0000
Subject: Re: Re: Sessions / Serialized Data
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-93369@lists.php.net to get a copy of this message
Julio Nobrega Trabalhando wrote: > > That would be easier. fopen the session file and store the information on > a database. Later you just fwrite the contents to a new file. I don't use PHP4 sessions since I cook my own, but I think the above won't work. My guess is that if you read the file, then save to DB that part will work fine. However, when you try to restore the session, the session has already loaded, you grab your data from the DB, and write over the file, your page finishes and writes the current session over what you think you just made the current session. Strikes me you'd need to unserialize into the current session structure... which I think can be found somewhere in the GLOBALS hash. Cheers Rob. -- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummings@webmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'

« previous php.general (#93369) next »