Re: Sessions question

From: Date: Tue, 27 Feb 2001 23:02:38 +0000
Subject: Re: Sessions question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41907@lists.php.net to get a copy of this message
You probably need to "unset" the cookie PHP is using to store the session ID when you destroy the session. Change your cookie handling in your browser to the "warn me before every cookie" and play around a bit maybe. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Evelio Martinez <evelio.martinez@testanet.com> Newsgroups: php.general Sent: Monday, February 26, 2001 11:58 AM Subject: [PHP] Sessions question > > 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'); > } > file://--> > </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'); > } > file://--> > </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 (#41907) next »