Then there's session_destroy() too.

If I ever suggest something that seems correct on the surface, but
there's a good reason to use something else, even in particular cases,
feel free to let me know.  I think I know PHP fairly well, but it's so
flexible and there are usually a dozen ways to do things, I find a way
that work and use it.  I figure if you want to get rid of all your
session data, session_destroy() would do that.

Guess you'd have to do another session_start() after that though,
wouldn't you?  Hmm..    See what happens when I use my brain?

-TG

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 28, 2004 8:33 AM
> To: [EMAIL PROTECTED]
> Cc: Ford, Mike [LSS]
> Subject: RE: [PHP] Using unset with $_SESSION
> 
> 
> > > Shouldn't unset($_SESSION) work?
> > 
> > No.  The following Caution appears in the manual (at
> > http://www.php.net/manual/en/ref.session.php#session.examples): 
> > 
> > Caution Do NOT unset the whole $_SESSION with unset($_SESSION) as
> > this will disable the registering of session variables through the
> > $_SESSION superglobal. 
> 
> Thanks -- I have to say I missed that one!
> 
> Thanks for noting session_write_close() as well.  I did try that, but 
> it didn't seem to offer any advantages over letting the script write 
> the data on exit.
> 
>  ----------
>  Tom Rawson
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to