On 27 January 2004 16:20, [EMAIL PROTECTED] wrote:

> On 27 Jan 2004 Stuart wrote:
> 
> > In that case, try this...
> > 
> > foreach (array_keys($_SESSION) as $key)
> >      unset($_SESSION[$key]);
> 
> Yes, I had tried that but forgot to mention it.  It does work.
> 
> However, I'm still mystified as to why unset($_SESSION) not only
> doesn't remove old data from the sesison file when the script exits,
> but prevents the new variable I create after that from being saved.
> 
> Perhaps $_SESSION as created by PHP is special and is tied to the
> session storage, whereas if it is destroyed with unset and then
> recreated that link is lost.  That would explain the behavior.

Yes, that is exactly the case.

You might like to take a look at session_write_close()
(http://www.php.net/session-write-close) in addition to the other
recommendations.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

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

Reply via email to