Jump to content
Larry Ullman's Book Forums

Recommended Posts

Not sure if I am getting this, I followed along and still I am seeing the PHPSESSID

here is the code <?php // Script 9.8 - logout.php

/*

*

* Session ID is still present

* I am using a Edit this Cookie

* A Chrome Add On for working with

* Cookies, still seeing the

* PHPSESSID | localhost

*/

// Need the session

session_start();

// Delete the session variable

unset($_SESSION);

// Reset the session array

$_SESSION = array();

 

session_destroy();

// Define the page title and include the header

define('TITLE', 'Log Out!');

require('_includes/header.html');

 

echo '<h2>Log Out Page!</h2>';

 

require('_includes/footer.html');

?>

Why am I still seeing the session ID ?

 

Thanks so much! :rolleyes:

Link to comment
Share on other sites

You're still seeing the session ID cookie because the code isn't deleting the cookie itself. That's an extra step you could take. This code just wipes out the data on the server. If you went to another page, the same session ID would be used (because the cookie's still there), but there would be no session data.

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...