Skip to content

Commit 79a2b0c

Browse files
committed
Fixed deleting
1 parent a614fb1 commit 79a2b0c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/FirestoreSessionHandler.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ public function close()
7777
*/
7878
public function read($sessionId)
7979
{
80+
$snapshot = $this->getCollection()->document($sessionId)->snapshot();
81+
82+
if (empty($this->getCollection()->document($sessionId)->snapshot()->data())) {
83+
return '';
84+
}
85+
8086
$session = (object) $this->getCollection()->document($sessionId)->snapshot()->data();
8187

8288
if ($this->expired($session)) {
@@ -205,7 +211,7 @@ protected function userAgent()
205211
*/
206212
public function destroy($sessionId)
207213
{
208-
$this->getCollection()->document($sessionId)->reference()->delete();
214+
$this->getCollection()->document($sessionId)->delete();
209215

210216
return true;
211217
}

0 commit comments

Comments
 (0)