RE: [PHP] tar baby sessions

From: Date: Fri, 04 Aug 2000 23:56:07 +0000
Subject: RE: [PHP] tar baby sessions
Groups: php.general 
Request: Send a blank email to php-general+get-10221@lists.php.net to get a copy of this message
why not delete the session file (or database entry) that the cookie points to, and tell it if !session_file to create a new one and start over? Respectfully: Michael Richardson -----Original Message----- From: rusty@grunt.berkeley.edu [mailto:rusty@grunt.berkeley.edu] Sent: Friday, August 04, 2000 4:52 PM To: php-general@lists.php.net Subject: [PHP] tar baby sessions 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); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#10221) next »