X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSession%2FCacheSessionHandler.php;h=1baf111e93ef60bcd0b04d7846ebf82b69932808;hb=50da89d861dce3b648c8f9e5c1e4c480ee320a43;hp=463fd33d3eff0d40de528b1446d64a892f9bef7d;hpb=27d94023eef0263a3ce9750f79a73ac941a25304;p=friendica.git diff --git a/src/Core/Session/CacheSessionHandler.php b/src/Core/Session/CacheSessionHandler.php index 463fd33d3e..1baf111e93 100644 --- a/src/Core/Session/CacheSessionHandler.php +++ b/src/Core/Session/CacheSessionHandler.php @@ -4,6 +4,7 @@ namespace Friendica\Core\Session; use Friendica\BaseObject; use Friendica\Core\Cache; +use Friendica\Core\Logger; use Friendica\Core\Session; use SessionHandlerInterface; @@ -13,7 +14,7 @@ require_once 'include/text.php'; /** * SessionHandler using Friendica Cache * - * @author Hypolite Petovan + * @author Hypolite Petovan */ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface { @@ -24,7 +25,7 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface public function read($session_id) { - if (!x($session_id)) { + if (empty($session_id)) { return ''; } @@ -33,7 +34,7 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface Session::$exists = true; return $data; } - logger("no data for session $session_id", LOGGER_TRACE); + Logger::log("no data for session $session_id", Logger::TRACE); return ''; } @@ -58,9 +59,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 +71,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)