[thelist] php: session help

Nemesis nemesis at nemesis1.f2o.org
Fri Jul 18 20:49:54 CDT 2003


Chris W. Parker wrote:

>Nemesis <mailto:nemesis at nemesis1.f2o.org>
>    on Friday, July 18, 2003 5:01 PM said:
>
>  
>
>>>If you are using PHP 4.3.2 use session_regenerate_id() to generate a
>>>new session id.
>>>      
>>>
>
>4.2.2
>
>Bummer. That would be easy.
>
>  
>
>>>I've tried session_destroy() and session_unset() but neither have
>>>worked. 
>>>
>>>      
>>>
>>You have to empty the cookie, pre 4.3.2. There are some good examples
>>at 
>>
>>    
>>
>
>Then on the logout page I have this:
>
><?
>// start the customers session
>	session_start();
>
>	$_SESSION = Array ();
>	session_destroy();
>
>	header("Location: {$_SERVER["HTTP_REFERER"]}");
>	exit;
>?>
>
>Both pages have session_start(); at the top. I removed some the logic
>and the comments from the login page but I copy and pasted verbatim the
>logout page. Do you see anything wrong with this?
>
>
>Chris.
>  
>
 Weird, I tried this a few minutes ago for logout  and it worked 
perfectly. It destroyed the session id making the old session useless.
|
session_destroy();

setcookie("SES_NAME","","","/");

header("somewhere");
exit;|

-- 
The Nemesis Project 
http://nemesis1.f2o.org
One Stop CSS




More information about the thelist mailing list