Re: Re-initiating an autostarted session

From: Date: Tue, 17 May 2005 13:05:44 +0000
Subject: Re: Re-initiating an autostarted session
References: 1 2 3 4 5 6 7 8 9  Groups: php.general 
Request: Send a blank email to php-general+get-215387@lists.php.net to get a copy of this message
disguised.jedi@gmail.com wrote:
Look in the user contributed notes in the session-destroy page. There is a function to wipe out the session and has worked nicely for me! http://www.php.net/session_destroy
Thank you for a message. Anyway, I could not get it working (the code follows) - I do still have exactly the same session id. I'm not sure if you meant that note as you spoke about a function. Anyway, I couldn't find any function that handles the cookies (only one about wiping out a session file from the server but it doesn't do anything for the cookie at the client's side). $CookieInfo = session_get_cookie_params(); if ( (empty($CookieInfo['domain'])) && (empty($CookieInfo['secure'])) ) { setcookie(session_name(), '', time()-3600, $CookieInfo['path']); } elseif (empty($CookieInfo['secure'])) { setcookie(session_name(), '', time()-3600, $CookieInfo['path'], $CookieInfo['domain']); } else { setcookie(session_name(), '', time()-3600, $CookieInfo['path'], $CookieInfo['domain'], $CookieInfo['secure']); } unset($_COOKIE[session_name()]); session_destroy(); session_write_close(); Header("Location: ..."); exit; Very mysterous... =/ Ville

« previous php.general (#215387) next »