Re: Session logic question

From: Date: Fri, 02 Jan 2004 22:02:05 +0000
Subject: Re: Session logic question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-173655@lists.php.net to get a copy of this message
Thanks for the reply. i just found the bug in my code. I had a statement in the second script: $_SESSION = $array; that obviously, completely replaced everything in the $_ SESSION buffer. These little I gotchas can be fun. Chris Shiflett wrote:
--- Al <news@ridersite.org> wrote:
Everything works fine, except when I include another script file that also uses the $_SESSION buffer. What appears to be happening is that start_session() on the second script reinitializes the session buffer and I lose the data from the first session.
Yes, as it should. You need to only start the session once. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security Handbook
    Coming mid-2004
HTTP Developer's Handbook
    http://httphandbook.org/
 


« previous php.general (#173655) next »