Skip to content

Commit d89bb3b

Browse files
authored
Merge pull request #1 from firevel/bugfix/fixed-flushing
Fixed session delete
2 parents 771549f + 79a2b0c commit d89bb3b

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
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
}

src/FirestoreSessionServiceProvider.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99

1010
class FirestoreSessionServiceProvider extends ServiceProvider
1111
{
12-
/**
13-
* Register services.
14-
*
15-
* @return void
16-
*/
17-
public function register()
18-
{
19-
//
20-
}
21-
2212
/**
2313
* Bootstrap services.
2414
*

0 commit comments

Comments
 (0)