mirror of
https://github.com/getgrav/grav.git
synced 2026-03-20 19:41:33 +01:00
Merge pull request #232 from flaviocopes/patch-2
Refresh session timeout
This commit is contained in:
@@ -21,15 +21,19 @@ class Session extends \RocketTheme\Toolbox\Session\Session
|
||||
$config = $this->grav['config'];
|
||||
|
||||
if ($config->get('system.session.enabled')) {
|
||||
$session_timeout = $config->get('system.session.timeout', 1800);
|
||||
$session_path = $config->get('system.session.path', '/' . ltrim($uri->rootUrl(false), '/'));
|
||||
|
||||
// Define session service.
|
||||
parent::__construct(
|
||||
$config->get('system.session.timeout', 1800),
|
||||
$config->get('system.session.path', '/' . ltrim($uri->rootUrl(false), '/'))
|
||||
$session_timeout,
|
||||
$session_path
|
||||
);
|
||||
|
||||
$site_identifier = $config->get('site.title', 'unkown');
|
||||
$this->setName($config->get('system.session.name', 'grav_site') . '_' . substr(md5($site_identifier), 0, 7));
|
||||
$this->start();
|
||||
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user