mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
Avoid restarting anonymous login sessions on 4.x (#1086)
Restrict recreating $_SESSION to only those where the user has been logged in previously; this should help stop anonymous users from failing a CSRF check. thanks @TrapoSAMA
This commit is contained in:
1 parent
db376c92a4
commit
bfe0b8cfd0
1 file changed
+3
-1
+3
-1
@@ -101,7 +101,9 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
error_log("PostfixAdmin admin login failed (username: $fUsername, ip_address: {$_SERVER['REMOTE_ADDR']})");
|
||||
flash_error($PALANG['pLogin_failed']);
|
||||
}
|
||||
} else {
|
||||
} elseif (isset($_SESSION['sessid'])) {
|
||||
// Do not restart anonymous sessions while rendering the login form.
|
||||
// An existing authenticated session should still be cleared before login.
|
||||
session_unset();
|
||||
session_destroy();
|
||||
session_start();
|
||||
|
||||
Reference in new issue
Block a user