Skip to content

Commit

Permalink
Fix "expires" option cannot have a year greater than 9999
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
halfgaar committed Mar 23, 2024
1 parent 76c23cf commit f525fed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions actions/admin/settings/110.accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'varname' => 'sessiontimeout',
'type' => 'number',
'min' => 60,
'max' => 31536000,
'default' => 600,
'save_method' => 'storeSettingField'
],
Expand Down
2 changes: 1 addition & 1 deletion lib/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit f525fed

Please sign in to comment.