diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-08-16 10:09:14 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-08-17 12:10:27 +0200 |
commit | 9e1d4312555ddc1009450b1f6b7078ae35790593 (patch) | |
tree | d82dd6d0742db12cdd491b887ed573fb7f75ff3f /lib/base.php | |
parent | 9b4b72826ade5ab1bc7fb06048e62910ef607cd8 (diff) | |
download | nextcloud-server-9e1d4312555ddc1009450b1f6b7078ae35790593.tar.gz nextcloud-server-9e1d4312555ddc1009450b1f6b7078ae35790593.zip |
Add config option to disable strict session timeout to be able to use read_and_close
Fixed https://github.com/nextcloud/server/issues/29356
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php index e787559c4c1..c0aee6c528f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -455,7 +455,9 @@ class OC { \OC::$server->getUserSession()->logout(); } - $session->set('LAST_ACTIVITY', time()); + if (!self::hasSessionRelaxedExpiry()) { + $session->set('LAST_ACTIVITY', time()); + } $session->close(); } @@ -467,6 +469,13 @@ class OC { } /** + * @return bool true if the session expiry should only be done by gc instead of an explicit timeout + */ + public static function hasSessionRelaxedExpiry(): bool { + return \OC::$server->getConfig()->getSystemValue('session_relaxed_expiry', false); + } + + /** * Try to set some values to the required Nextcloud default */ public static function setRequiredIniValues() { |