Re: session_destroy();

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, I've been struggling with the same problem. The following code will destroy the session information and remove the cookie

session_start();
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
  setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();

However my problem is that if I recreate the session in the same script the session file is created with exactly the same file name and creation time. Making me believe that the session is held in cache somewhere

graeme.

Chris Payne wrote:

Hi there everyone,



I need to destroy a session in the browser so when they log out it clears
all the session data from the browser, I have tried:



session_destroy();



But it doesn’t seem to do it as the browser keeps the same PHPSessionID.



What is the best way to destroy a session and generate a new sessionid
without having to close the browser and go back again?



Chris


--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.791 / Virus Database: 535 - Release Date: 11/8/2004





-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux