From b4f3182b387fa4bc88fd9ea9449bf35a2711814c Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 19 Jul 2024 15:16:09 +0200 Subject: [PATCH] Check if session is active before destroying it Fixes #600 --- src/Util/SessionWrapper.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Util/SessionWrapper.php b/src/Util/SessionWrapper.php index 6a3f0daa9..3200efd2f 100644 --- a/src/Util/SessionWrapper.php +++ b/src/Util/SessionWrapper.php @@ -29,8 +29,10 @@ public function destroy() : void ); } - session_destroy(); - session_regenerate_id(); + if (session_status() === PHP_SESSION_ACTIVE) { + session_destroy(); + session_regenerate_id(); + } } public function find(string $key) : mixed