From d0adc8198e05b6bd730ab5616458ac5160d8452c Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Sat, 23 Mar 2024 13:55:24 +0100 Subject: [PATCH] Fix "expires" option cannot have a year greater than 9999 This fixes the exception: '"expires" option cannot have a year greater than 9999', which happens on upgrade from Debian 11 to 12. The session timeout in the DB is 9999999999999, so we constrain the value. --- lib/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/init.php b/lib/init.php index 9b1a67b8fc..4583f68162 100644 --- a/lib/init.php +++ b/lib/init.php @@ -369,7 +369,7 @@ } // update cookie lifetime $cookie_params = [ - 'expires' => time() + Settings::Get('session.sessiontimeout'), + 'expires' => time() + min(Settings::Get('session.sessiontimeout'), 31536000), 'path' => '/', 'domain' => UI::getCookieHost(), 'secure' => UI::requestIsHttps(),