[thelist] php: session help

Chris W. Parker cparker at swatgear.com
Fri Jul 18 19:17:47 CDT 2003


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 
> 
> http://www.php.net/manual/en/function.session-destroy.php

Unfortunately I already know all about this page, nothing works.


What I'm doing is logging in a user with thisL

$_SESSION['user_info'] = Array (
					"status" => "success",
					"user_level" => $user_level,
					"username" => $username,
					"session" => session_id()
					);

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.


More information about the thelist mailing list