mardi 28 mars 2017

PHP Login Form Session Variable Destroying

I am new to PHP and currently I am creating a login screen with a session variable. I am trying to destroy or unset my session variable when logging out but it doesn't seem to work.

My session variable:

$_SESSION['CurrentUser']

This is the button which should end the session:

<input type="submit" name="logout" id="logout" value="Log out">

When pressing a button:

if(isset($_POST['logout']))
{
    session_unset();  
    session_destroy(); 
}

Thank you in advance




Aucun commentaire:

Enregistrer un commentaire