Use SESSION_DURATION option to define the session lifetime stored in the
database The option `SESSION_DURATION` is used to define the cookie lifetime. With this change, Kanboard will try to use first `SESSION_DURATION` instead of the default `session.gc_maxlifetime` value. Fixes #4340
This commit is contained in:
committed by
Frédéric Guillot
parent
1c90a0ce57
commit
4adb93c1a6
@@ -58,7 +58,11 @@ class SessionHandler implements SessionHandlerInterface
|
|||||||
#[\ReturnTypeWillChange]
|
#[\ReturnTypeWillChange]
|
||||||
public function write($sessionID, $data)
|
public function write($sessionID, $data)
|
||||||
{
|
{
|
||||||
|
if (SESSION_DURATION > 0) {
|
||||||
|
$lifetime = time() + SESSION_DURATION;
|
||||||
|
} else {
|
||||||
$lifetime = time() + (ini_get('session.gc_maxlifetime') ?: 1440);
|
$lifetime = time() + (ini_get('session.gc_maxlifetime') ?: 1440);
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->startTransaction();
|
$this->db->startTransaction();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user