1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-30 18:21: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

@@ -43,6 +43,8 @@ if (!isset($_SESSION['SESS_REMOTE_UA'])) {
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > $SESSION_LIFETIME)) {
session_unset();
session_destroy();
// After destroying session, we need to reset the User-Agent for the new session
$_SESSION['SESS_REMOTE_UA'] = $_SERVER['HTTP_USER_AGENT'];
}
$_SESSION['LAST_ACTIVITY'] = time();