diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/SessionService.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Service/SessionService.php b/lib/Service/SessionService.php index eab4fec8c..f06cb553b 100644 --- a/lib/Service/SessionService.php +++ b/lib/Service/SessionService.php @@ -165,12 +165,17 @@ class SessionService { try { $data = $this->sessionMapper->find($documentId, $sessionId, $token); - $this->cache->set($token, json_encode($data), self::SESSION_VALID_TIME - 30); - return $data; + $jsonData = json_encode($data); + + if ($jsonData) { + $this->cache->set($token, json_encode($data), self::SESSION_VALID_TIME - 30); + return $data; + } } catch (DoesNotExistException $e) { - $this->session = false; - return false; } + + $this->session = false; + return false; } public function isValidSession($documentId, $sessionId, $token): bool { |