Remove invalid cookie

If cookie is invalid, it is cleared from the browser before continuing
This commit is contained in:
Rob Gill
2018-05-10 08:54:44 +10:00
committed by GitHub
parent adeec42dd4
commit 5733d08745

View File

@@ -43,9 +43,14 @@
if (isset($_COOKIE["persistentlogin"]))
{
if ($pwhash = $_COOKIE["persistentlogin"])
$auth = true;
{ $auth = true;
// Refresh cookie with new expiry
setcookie('persistentlogin', $pwhash, time()+60*60*24*7);
else
// Invalid cookie
$auth = false;
setcookie('persistentlogin', '');
}
}
// Compare doubly hashes password input with saved hash
else if(isset($_POST["pw"]))