Re: session_unset doesn't end the session. Was: [PHP-DEV] Sessions - lack of support for endingn a session and beginning a new one.
| From: | Daniel Beckham | Date: | Mon, 05 Jun 2000 19:36:14 +0000 |
| Subject: | Re: session_unset doesn't end the session. Was: [PHP-DEV] Sessions - lack of support for endingn a session and beginning a new one. | ||
| References: | 1 2 3 4 5 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-20282@lists.php.net to get a copy of this message | ||
Well, I only need to end it so that I could resume a older session with a different session id. Calling session_start() a second time doesn't do anything.
session.c:717
if (PS(nr_open_sessions) != 0)
return;That piece of code seems to exit session_start if there is already an active session. My reason for this is to allow a user to "login" and get his site preferences back if he happens to view our site from his office, or friends house... If sessions are autostarted or put in prepend file, it wouldn't be possible really do that without a big kluge... Daniel At 02:31 PM 06/05/2000 -0500, you wrote:
On Mon, 05 Jun 2000, Daniel Beckham wrote: Ok, I tried using session_unset() before session_start(), but it doesn't do what I was hoping. I grabbed the latest phpdoc cvs and took a look at the session docs and the synopsis for session_unset() is: The session_unset function free's all session variables currently registered. Unless the docs just aren't clear, it doesn't end the session, just un-registers all of the registered variables for me. session_unset() unsets all the registered session variables. session_destroy() will destroy the session. There is no session_end() as far as I'm aware - but is there a big need for it? Your session is saved at the end of each request. -Andrei "Freedom comes when you learn to let go. Creation comes when you learn to say no."-madonna