diff --git a/system/Session/Handlers/DatabaseHandler.php b/system/Session/Handlers/DatabaseHandler.php index 59bb5c2e7fda..9d3ba2436897 100644 --- a/system/Session/Handlers/DatabaseHandler.php +++ b/system/Session/Handlers/DatabaseHandler.php @@ -312,17 +312,17 @@ protected function releaseLock(): bool */ private function now($interval = null): string { - $DBDriver = service('settings')->get("Database.{$this->DBGroup}")['DBDriver']; - return !is_null($interval) + $DBDriver = config(Database::class)->{$this->DBGroup}['DBDriver']; + return null === $interval ? match($DBDriver) { - 'SQLite3' => "datetime('now', '-{$interval}')", - default => "now() - INTERVAL {$interval}", + 'SQLite3' => "datetime('now')", + default => "now()", } : match($DBDriver) { - 'SQLite3' => "datetime('now')", - default => "now()", + 'SQLite3' => "datetime('now', '-{$interval}')", + default => "now() - INTERVAL {$interval}", }; } }