diff --git a/CHANGELOG.md b/CHANGELOG.md index 77e958a0f..611b3ca18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Fix for `Page::translatedLanguages()` to use routes always [#2163](https://github.com/getgrav/grav/issues/2163) * Fixed `nicetime()` twig function * Allow twig tags `{% script %}`, `{% style %}` and `{% switch %}` to be placed outside of blocks + * Session expires in 30 mins independent from config settings [login#178](https://github.com/getgrav/grav-plugin-login/issues/178) # v1.5.1 ## 08/23/2018 diff --git a/system/src/Grav/Framework/Session/Session.php b/system/src/Grav/Framework/Session/Session.php index 3c2a417e1..c060345a5 100644 --- a/system/src/Grav/Framework/Session/Session.php +++ b/system/src/Grav/Framework/Session/Session.php @@ -14,6 +14,8 @@ namespace Grav\Framework\Session; */ class Session implements SessionInterface { + protected $options; + /** * @var bool */ @@ -182,7 +184,10 @@ class Session implements SessionInterface unset($_COOKIE[session_name()]); } - $options = $readonly ? ['read_and_close' => '1'] : []; + $options = $this->options; + if ($readonly) { + $options['read_and_close'] = '1'; + } $success = @session_start($options); if (!$success) { @@ -335,6 +340,7 @@ class Session implements SessionInterface $value = (string)$value; } + $this->options[$key] = $value; ini_set($key, $value); } }