X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSession%2FHandler%2FDatabase.php;h=41ccb6b33f834e4f315fef4b6b78a5f2813bebff;hb=2edbd1a3e2b90430b378de32f79a7cbd3537d9de;hp=b18d55db7ceb2b49d23ce97a77c89960a20de26f;hpb=24f8ee8e676abf4dd16916fd417562aca7bcbb9f;p=friendica.git diff --git a/src/Core/Session/Handler/Database.php b/src/Core/Session/Handler/Database.php index b18d55db7c..41ccb6b33f 100644 --- a/src/Core/Session/Handler/Database.php +++ b/src/Core/Session/Handler/Database.php @@ -1,6 +1,6 @@ dba->selectFirst('session', ['data'], ['sid' => $id]); if ($this->dba->isResult($session)) { - Session::$exists = true; + $this->sessionExists = true; return $session['data']; } } catch (\Exception $exception) { - $this->logger->warning('Cannot read session.'. ['id' => $id, 'exception' => $exception]); + $this->logger->warning('Cannot read session.', ['id' => $id, 'exception' => $exception]); return ''; } @@ -101,11 +101,11 @@ class Database implements SessionHandlerInterface return $this->destroy($id); } - $expire = time() + Session::$expire; + $expire = time() + static::EXPIRE; $default_expire = time() + 300; try { - if (Session::$exists) { + if ($this->sessionExists) { $fields = ['data' => $data, 'expire' => $expire]; $condition = ["`sid` = ? AND (`data` != ? OR `expire` != ?)", $id, $data, $expire]; $this->dba->update('session', $fields, $condition); @@ -114,7 +114,7 @@ class Database implements SessionHandlerInterface $this->dba->insert('session', $fields); } } catch (\Exception $exception) { - $this->logger->warning('Cannot write session.'. ['id' => $id, 'exception' => $exception]); + $this->logger->warning('Cannot write session.', ['id' => $id, 'exception' => $exception]); return false; } @@ -131,7 +131,7 @@ class Database implements SessionHandlerInterface try { return $this->dba->delete('session', ['sid' => $id]); } catch (\Exception $exception) { - $this->logger->warning('Cannot destroy session.'. ['id' => $id, 'exception' => $exception]); + $this->logger->warning('Cannot destroy session.', ['id' => $id, 'exception' => $exception]); return false; } } @@ -141,7 +141,7 @@ class Database implements SessionHandlerInterface try { return $this->dba->delete('session', ["`expire` < ?", time()]); } catch (\Exception $exception) { - $this->logger->warning('Cannot use garbage collector.'. ['exception' => $exception]); + $this->logger->warning('Cannot use garbage collector.', ['exception' => $exception]); return false; } }