note 42481 added to ref.session

From: Date: Tue, 18 May 2004 15:52:31 +0000
Subject: note 42481 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-69777@lists.php.net to get a copy of this message
When using sessions for a user login system, I noticed that after entering a username/password and then selecting to go back in the browser and entering a different username/password combination the first session details were still active. This can be combatted with the code below on the login screen. <?php /* If session active unset & destroy else start session */ if(session_start()){ session_unset(); session_destroy(); }else{ session_start(); } ?> ---- Manual Page -- http://www.php.net/manual/en/ref.session.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42481 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42481&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42481&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69777) next »