]> git.mxchange.org Git - friendica.git/commitdiff
Add support for empty session write
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 8 Aug 2020 02:50:16 +0000 (22:50 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 8 Aug 2020 02:50:16 +0000 (22:50 -0400)
- Ignored empty data left session intact, leading to unexpected behaviors

src/Core/Session/Handler/Cache.php
src/Core/Session/Handler/Database.php

index 5aec68e634f2746e31d8a5bcf19e8214daffaa70..af82deb5864d05f28f77c6079282c5541b81ee0b 100644 (file)
@@ -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);
index 3c2f9027a5646cccd321995ac97aaa84e3dc1d5c..c61402954d1626450affb0dcda700690b2420cb5 100644 (file)
@@ -94,7 +94,7 @@ class Database implements SessionHandlerInterface
                }
 
                if (!$session_data) {
-                       return true;
+                       return $this->destroy($session_id);
                }
 
                $expire         = time() + Session::$expire;