From bc02ad89d0869496f9f26a969f211d3d1365d4d3 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 7 Aug 2020 22:50:16 -0400 Subject: [PATCH] Add support for empty session write - Ignored empty data left session intact, leading to unexpected behaviors --- src/Core/Session/Handler/Cache.php | 2 +- src/Core/Session/Handler/Database.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Session/Handler/Cache.php b/src/Core/Session/Handler/Cache.php index 5aec68e634..af82deb586 100644 --- a/src/Core/Session/Handler/Cache.php +++ b/src/Core/Session/Handler/Cache.php @@ -87,7 +87,7 @@ class Cache implements SessionHandlerInterface } if (!$session_data) { - return true; + return $this->destroy($session_id); } return $this->cache->set('session:' . $session_id, $session_data, Session::$expire); diff --git a/src/Core/Session/Handler/Database.php b/src/Core/Session/Handler/Database.php index 3c2f9027a5..c61402954d 100644 --- a/src/Core/Session/Handler/Database.php +++ b/src/Core/Session/Handler/Database.php @@ -94,7 +94,7 @@ class Database implements SessionHandlerInterface } if (!$session_data) { - return true; + return $this->destroy($session_id); } $expire = time() + Session::$expire;