RE: [PHP-WIN] RE: Sessions - Bug? ALL FIXED :)

From: Date: Tue, 29 Aug 2000 15:52:10 +0000
Subject: RE: [PHP-WIN] RE: Sessions - Bug? ALL FIXED :)
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2268@lists.php.net to get a copy of this message
Oh I feel like a Muppet! I've worked out my so called session problems. Not a fault with PHP at all (as I expected) but my understanding of the commands. I blame the manual (never blame yourself if you can get away with it is my motto!). Okay this is my understanding of the session commands now (I don't think the manual makes it very clear but a week of experimenting (okay I'm slow!) has revealed the answers). For expert PHP users, you can start laughing NOW ;) session_start Even I understood that command ;) session_register("Variable"); Understood that as well, except at first I forgot the double quotes - DOH! session_unset(); This is where the confusion began. My understanding now of this command is that it deletes (forgets) all session variable values from memory and file. session_unregister("Variable"); More confusion here. My understanding now of this command is that it deletes (forgets) the named variable from the session file. session_destroy(); Total confusion here. I completely misunderstood the purpose of this command! LOL. I thought its purpose was to remove all contents from the session file - i.e. kill the session. However, you have to use session_unset and session_unregister for this purpose. By issuing a session_unset and session_unregisters for all registered variables the end result is a 0 byte session file and no session variables in memory. This is what I thought session_destroy should do!!!! My understanding now for the session_destroy command is that it resets the variable values of the session file (but NOT the memory variables) back to the value they had BEFORE the last session_start command was issued. Wow. I can't believe it. All figured out and working. My headache is going already. Just need those BT shares to start rising now and I can take a holiday! LOL Thanks for everyone's help on this matter and I hope this helps others who were suffering as well. Yours James -----Original Message----- From: Andy Hoffman [mailto:andy.hoffman@bms.com] Sent: 29 August 2000 14:53 To: James Duncan; php-windows@lists.php.net Subject: Re: [PHP-WIN] RE: Sessions - Bug? Oooo, just had another thought... what about double-quotes around your session.save_path setting... PHP is rather particular about HOW you specify file/directory paths in the php.ini. Try double-quoting your director name, AND perhaps switching to front-slashes instead of back-slashes. > > session.save_path = c:\session\ -- Andy Hoffman Web Developer Bristol-Myers Squibb email: andy.hoffman@bms.com

« previous php.windows (#2268) next »