Re: [PHP] Using unset with $_SESSION

2004-01-29 Thread Justin Patrin
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

RE: [PHP] Using unset with $_SESSION

2004-01-28 Thread Ford, Mike [LSS]
On 27 January 2004 15:52, [EMAIL PROTECTED] wrote: I am trying to find a reliable method to clean out all session variables and start clean. Running PHP 4.3.1 on Win2K developing a web app to run on Linux. Session cookies are enabled, register globals is off. I access all session

RE: [PHP] Using unset with $_SESSION

2004-01-28 Thread Ford, Mike [LSS]
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

RE: [PHP] Using unset with $_SESSION

2004-01-28 Thread trlists
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

RE: [PHP] Using unset with $_SESSION

2004-01-28 Thread Gryffyn, Trevor
- 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

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread Stuart
[EMAIL PROTECTED] wrote: I am trying to find a reliable method to clean out all session variables and start clean. http://php.net/session_destroy -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread trlists
On 27 Jan 2004 Stuart wrote: I am trying to find a reliable method to clean out all session variables and start clean. http://php.net/session_destroy That destroys the file but (at least the docs say) does not clean out the global variables, and does not seem to work in my example.

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread Stuart
[EMAIL PROTECTED] wrote: On 27 Jan 2004 Stuart wrote: I am trying to find a reliable method to clean out all session variables and start clean. http://php.net/session_destroy That destroys the file but (at least the docs say) does not clean out the global variables, and does not seem to work in

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread trlists
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