]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Session/CacheSessionHandler.php
Merge remote-tracking branch 'upstream/develop' into item-thread
[friendica.git] / src / Core / Session / CacheSessionHandler.php
index 463fd33d3eff0d40de528b1446d64a892f9bef7d..3ebdb99e167a499502940ae2c0f337489458dbac 100644 (file)
@@ -13,7 +13,7 @@ require_once 'include/text.php';
 /**
  * SessionHandler using Friendica Cache
  *
- * @author Hypolite Petovan <mrpetovan@gmail.com>
+ * @author Hypolite Petovan <hypolite@mrpetovan.com>
  */
 class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
 {
@@ -24,7 +24,7 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
 
        public function read($session_id)
        {
-               if (!x($session_id)) {
+               if (empty($session_id)) {
                        return '';
                }
 
@@ -58,9 +58,9 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
                        return true;
                }
 
-               Cache::set('session:' . $session_id, $session_data, Session::$expire);
+               $return = Cache::set('session:' . $session_id, $session_data, Session::$expire);
 
-               return true;
+               return $return;
        }
 
        public function close()
@@ -70,8 +70,9 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
 
        public function destroy($id)
        {
-               Cache::delete('session:' . $id);
-               return true;
+               $return = Cache::delete('session:' . $id);
+
+               return $return;
        }
 
        public function gc($maxlifetime)