Re: session_id and cookie settings

From: Date: Tue, 02 Mar 2004 16:37:01 +0000
Subject: Re: session_id and cookie settings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-179267@lists.php.net to get a copy of this message
Firs of all I think it would be easier to conult PHP Help before posting. Quoting from PHP Help - function session_destroy(): " mcknight@chek.com (18-Jan-2002 02:26) When users log in and out of your site they will keep the original session you have set for them. if you need to have this change on each login then you should use the setcookie function to remove the session id on each logout. for instance: //remove the local session session_destroy(); //remove the client session setcookie("SES_NAME","","","/"); //redirect user with header header("somewhere"); exit; " Also from PHP Help: "session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the session, or unset the session cookie." "Torsten" <t.lange@ufz.de> wrote in message news:20040302133348.58472.qmail@pb1.pair.com... > Hi, > when I destroy my session and reload my index.php. I get the same > session_id() that was just destroyed before. I've checked it after > session_destroy() with echo session(); The function returned no value > anymore. But as I said, when starting a new session the old session_id is > reappearing. Only when I set off the cookie option in my browser > session_start() gives a new session_id. > > I get really confused with it, because I thought that the session_id is > generated by php (a remote machine in my case) and has nothing to do with > the browser, exept I would actively set cookies. How can code it that way, > that non-independend from the cookie settings in the browser I always can be > sure to have a really new session_id? > > Thank you, > Torsten

« previous php.general (#179267) next »