Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/SessionService.php13
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 {