Skip to content

Commit

Permalink
Merge pull request #1 from firevel/bugfix/fixed-flushing
Browse files Browse the repository at this point in the history
Fixed session delete
  • Loading branch information
sl0wik authored Jun 23, 2019
2 parents 771549f + 79a2b0c commit d89bb3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 7 additions & 1 deletion src/FirestoreSessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public function close()
*/
public function read($sessionId)
{
$snapshot = $this->getCollection()->document($sessionId)->snapshot();

if (empty($this->getCollection()->document($sessionId)->snapshot()->data())) {
return '';
}

$session = (object) $this->getCollection()->document($sessionId)->snapshot()->data();

if ($this->expired($session)) {
Expand Down Expand Up @@ -205,7 +211,7 @@ protected function userAgent()
*/
public function destroy($sessionId)
{
$this->getCollection()->document($sessionId)->reference()->delete();
$this->getCollection()->document($sessionId)->delete();

return true;
}
Expand Down
10 changes: 0 additions & 10 deletions src/FirestoreSessionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@

class FirestoreSessionServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
//
}

/**
* Bootstrap services.
*
Expand Down

0 comments on commit d89bb3b

Please sign in to comment.