tar baby sessions
| From: | rusty at grunt dot berkeley dot edu | Date: | Fri, 04 Aug 2000 23:51:30 +0000 |
| Subject: | tar baby sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-10220@lists.php.net to get a copy of this message | ||
Anybody have suggestions or hints about how to really destroy a
session so that when you go back to a page that started the session,
you don't get reconnected to the previous session? The problem seems
to be when sessions are being managed with cookies; the cookie is a
session cookie and you have to quit and restart your browser to get
rid of it. I'm looking for a way in php to make the session cookie go
away and get recreated afresh but not having any success. I'm using
the following code to record the session id in a database under the
user's login (email address); the commented out code is my attempt to
destroy any existing session but it doesn't work.
function pr_sess_create($pr_email) {
global $errmsg;
$pr_email = addslashes($pr_email);
session_start();
// if (session_is_registered("active")) {
// error_log("destroying session " . session_id(), 0);
// session_destroy();
// setcookie(session_name());
// session_start();
// }
// $active = 1;
// session_register("active");
$pr_session = session_id();
$query = "update tbl_pr set pr_session='$pr_session' where pr_email='$pr_email
'";
$data = new db_cci($query);
if ($data->db_err) {
$errmsg = "Query failed: " . $query . "; $data->db_err";
return(0);
}
unset($data);
return(1);
}