Add SessionUsers class including tests

This commit is contained in:
Philipp 2022-10-18 22:20:04 +02:00
parent 66a4c30eb7
commit 940619325d
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
9 changed files with 542 additions and 5 deletions

View file

@ -61,7 +61,7 @@ class Cache implements SessionHandlerInterface
return $data;
}
} catch (CachePersistenceException $exception) {
$this->logger->warning('Cannot read session.'. ['id' => $id, 'exception' => $exception]);
$this->logger->warning('Cannot read session.', ['id' => $id, 'exception' => $exception]);
return '';
}

View file

@ -70,7 +70,7 @@ class Database implements SessionHandlerInterface
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 '';
}
@ -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;
}
}