php session_destroy question

  • From: BlueScale <bluescale1976@xxxxxxx>
  • To: "programmingblind@xxxxxxxxxxxxx" <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 01 Sep 2008 12:55:40 -0400

Hi,
I have some logout code that isn't working exactly as it should.  It's
not unsetting all the variables, because when I log back in, things
aren't changed back to their default behavior.  Here's my code:
<?php
//start the session
session_start();
//clear session variables
$_SESSION = array();
//delete session cookie if it is set
if (isset($_COOKIE[session_name()]))
{
setcookie(session_name(), '', time()-1000000, '/');
}
//destroy the session
session_destroy();
php?>
Thanks for the help
BlueScale

Other related posts:

  • » php session_destroy question