Sessions question

From: Date: Mon, 26 Feb 2001 18:01:54 +0000
Subject: Sessions question
Groups: php.general 
Request: Send a blank email to php-general+get-41714@lists.php.net to get a copy of this message
How can I have an new session id without closing the browser? session.inc contains basically the postgresql session functions (user handler) in http://www.php.net/manual/en/ref.session.php I have change pg_pconnect for pg_connect and I have added pg_destroy_session. 1. There is a login/password page 2. Afterwards all pages that access the DB have the following include file: <? include('sesion.inc'); if (!isset($g_login)) { // flag that indicates that validation was succesful echo "<script language='javascript'> <!-- var lugar = window.location.href; if ( lugar != \"http://www.my_web.com/login.php\" ) { window.location.assign('http://www.my_web.com/login.php'); } //--> </script>"; } if (isset($g_hora)) { $timeout = 3600 ; $lapso = time() - $g_hora; if ( $lapso >= $timeout ) { session_destroy(); // delete session from database session_unset(); // suppose to delete session variable from memory $sesion = md5(uniqid("prueba")); session_id($sesion); // new session echo "<script language='javascript'> <!-- var lugar = window.location.href; var lugars; window.alert('La sesión ha expirado'); var lugar = window.location.href; if ( lugar != \"http://www.my_web.com/login.php\" ) { window.location.assign('http://www.my_web.com/login.php'); } //--> </script>"; } } ?> 3. How am I supposed to create a new session identificator ? session_unset is suppose to "free" (delete?) all session variables currently registered, isn't it? After timeout, it goes to login page but I have still the old session id instead of the new one. What am I missing? TIA -- Evelio Martínez

« previous php.general (#41714) next »