Redirect the user in a POST-Redirect-GET fashion after a successful login

This commit is contained in:
Andres Rey
2017-10-10 10:40:18 +01:00
parent c5537961f0
commit 33db4f2842

View File

@@ -40,6 +40,13 @@
if($postinput == $pwhash)
{
$_SESSION["hash"] = $pwhash;
// Login successful, redirect the user to the homepage to discard the POST request
if ($_SERVER['REQUEST_METHOD'] === 'POST' && $_SERVER['QUERY_STRING'] === 'login') {
header(sprintf('Location: index.php'));
exit();
}
$auth = true;
}
else