mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
Keep 4.x login CSRF token stable across repeated GETs (#1087)
Do not recreate the CSRF token in the session if one already exists, this should avoid people seeing an expired CSRF token error thanks @TrapoSAMA
This commit is contained in:
1 parent
bfe0b8cfd0
commit
26c56cf0e8
1 file changed
+4
-1
+4
-1
@@ -109,7 +109,10 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
session_start();
|
||||
}
|
||||
|
||||
$_SESSION['PFA_token'] = md5(uniqid("pfa" . rand(), true));
|
||||
if (empty($_SESSION['PFA_token'])) {
|
||||
// Keep the login token stable across repeated GETs in this session.
|
||||
$_SESSION['PFA_token'] = md5(uniqid("pfa" . rand(), true));
|
||||
}
|
||||
|
||||
$smarty->assign('language_selector', language_selector(), false);
|
||||
$smarty->assign('smarty_template', 'login');
|
||||
|
||||
Reference in new issue
Block a user