[HttpFoundation] Use the correct syntax for session gc based on Pdo driver
This commit is contained in:
parent
4f47bb73a0
commit
826dfbd496
@ -375,7 +375,11 @@ class PdoSessionHandler implements \SessionHandlerInterface
|
|||||||
$this->gcCalled = false;
|
$this->gcCalled = false;
|
||||||
|
|
||||||
// delete the session records that have expired
|
// delete the session records that have expired
|
||||||
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time - $this->timeCol";
|
if ('mysql' === $this->driver) {
|
||||||
|
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol + $this->timeCol < :time";
|
||||||
|
} else {
|
||||||
|
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time - $this->timeCol";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = $this->pdo->prepare($sql);
|
$stmt = $this->pdo->prepare($sql);
|
||||||
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
|
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
|
||||||
|
Reference in New Issue
Block a user