Skip to content

Commit 11d9721

Browse files
grimpiratemichalsn
andauthored
refactor: cleanup DatabaseHandler::gc() for session (#9230)
* Removal of unneeded operations/variables * Update system/Session/Handlers/DatabaseHandler.php --------- Co-authored-by: Michal Sniatala <[email protected]>
1 parent 4a7fbd1 commit 11d9721

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

system/Session/Handlers/DatabaseHandler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,9 @@ public function destroy($id): bool
282282
#[ReturnTypeWillChange]
283283
public function gc($max_lifetime)
284284
{
285-
$separator = ' ';
286-
$interval = implode($separator, ['', "{$max_lifetime} second", '']);
287-
288285
return $this->db->table($this->table)->where(
289286
'timestamp <',
290-
"now() - INTERVAL {$interval}",
287+
"now() - INTERVAL {$max_lifetime} second",
291288
false
292289
)->delete() ? 1 : $this->fail();
293290
}

0 commit comments

Comments
 (0)