diff --git a/src/Bridges/HttpDI/SessionExtension.php b/src/Bridges/HttpDI/SessionExtension.php index f3d13b47..ed9fdf91 100644 --- a/src/Bridges/HttpDI/SessionExtension.php +++ b/src/Bridges/HttpDI/SessionExtension.php @@ -91,6 +91,10 @@ public function loadConfiguration() $options['autoStart'] = false; } + if ($config->readAndClose === null) { + unset($options['readAndClose']); + } + if (!empty($options)) { $session->addSetup('setOptions', [$options]); } diff --git a/src/Http/Session.php b/src/Http/Session.php index 87536242..a591f736 100644 --- a/src/Http/Session.php +++ b/src/Http/Session.php @@ -405,7 +405,7 @@ public function setOptions(array $options) $normalized[$normKey] = $value; } - if (array_key_exists('read_and_close', $normalized)) { + if (isset($normalized['read_and_close'])) { if (session_status() === PHP_SESSION_ACTIVE) { throw new Nette\InvalidStateException('Cannot configure "read_and_close" for already started session.'); }