Session expires in 30 mins independent from config settings (https://github.com/getgrav/grav-plugin-login/issues/178)

This commit is contained in:
Matias Griese
2018-09-13 17:31:11 +03:00
parent bbc4fd6c79
commit da95d1bb1e
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -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);
}
}