1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-21 05:41:31 +00:00

Fix User-Agent validation error after session expiry and regeneration

Co-authored-by: DerLinkman <62480600+DerLinkman@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-12 15:51:56 +00:00
parent 3e5a58be8f
commit 19225b223c
4 changed files with 3695 additions and 3685 deletions

View File

@@ -7,6 +7,8 @@ if (!empty($_GET['sso_token'])) {
session_regenerate_id(true);
$_SESSION['mailcow_cc_username'] = $username;
$_SESSION['mailcow_cc_role'] = 'domainadmin';
// Update User-Agent after session regeneration to prevent validation errors
$_SESSION['SESS_REMOTE_UA'] = $_SERVER['HTTP_USER_AGENT'];
header('Location: /domainadmin/mailbox');
}
}
@@ -61,6 +63,8 @@ if (isset($_POST["login_user"]) && isset($_POST["pass_user"])) {
session_regenerate_id(true);
$_SESSION['mailcow_cc_username'] = $login_user;
$_SESSION['mailcow_cc_role'] = "domainadmin";
// Update User-Agent after session regeneration to prevent validation errors
$_SESSION['SESS_REMOTE_UA'] = $_SERVER['HTTP_USER_AGENT'];
header("Location: /domainadmin/mailbox");
die();
}