From a5e2e1d14c8db93f0e0345fb0b063736e1dd674f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Mon, 8 Aug 2022 14:12:52 +0200 Subject: [PATCH] SessionExtension: don't set readAndClose if null Session class throws exception if session is started and option read_and_close is set. SessionExtension breaks compatibility with other session implementations (in case they already started the session) by always setting that option (to default value). --- src/Bridges/HttpDI/SessionExtension.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Bridges/HttpDI/SessionExtension.php b/src/Bridges/HttpDI/SessionExtension.php index 5647c273..f4e572b3 100644 --- a/src/Bridges/HttpDI/SessionExtension.php +++ b/src/Bridges/HttpDI/SessionExtension.php @@ -77,6 +77,10 @@ public function loadConfiguration() if ($config->autoStart === 'never') { $options['autoStart'] = false; } + + if ($config->readAndClose === null) { + unset($options['readAndClose']); + } if (!empty($options)) { $session->addSetup('setOptions', [$options]);