Tag Archives: session

use session create member log in wih mysql–continue

then you should create your logout.php

here is the code:

  // store to test if they *were* logged in
  $old_user = $_SESSION[‘valid_user’];  
<h1>Log out</h1>
  if (!empty($old_user))
    echo ‘Logged out.<br />’;
    // if they weren’t logged in but came to this page somehow
    echo ‘You were not logged in, and so have not been logged out.<br />’;
<a href=”authmain.php”>Back to main page</a>


Unsetting Variables and Destroying the Session

When you are finished with a session variable, you can unset it.You can do this directly
by unsetting the appropriate element of the $_SESSION array, as in this example:
Note that the use of session_unregister() and session_unset() is no longer
required and is not recommended.These functions were used prior to the introduction
You should not try to unset the whole $_SESSION array because doing so will effectively
disable sessions.To unset all the session variables at once, use
$_SESSION = array();
When you are finished with a session, you should first unset all the variables and
then call  session_destroy();
to clean up the session ID.