note 42481 deleted from ref.session by nlopess
| From: | nlopess@php.net | Date: | Wed, 19 May 2004 15:36:08 +0000 |
| Subject: | note 42481 deleted from ref.session by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69834@lists.php.net to get a copy of this message | ||
Note Submitter: craig@NOSPAM.deconstructor.net
----
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();
}
?>