bug #24579 pdo session fix (mxp100)

This PR was merged into the 2.7 branch.

Discussion
----------

pdo session fix

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24456
| License       | MIT
| Doc PR        |

Fix PDO session timestamp out of range for postgres. (branch from 2.7)
P.S. please delete this pull https://github.com/symfony/symfony/pull/24457

Commits
-------

56b29a754c pdo session fix
This commit is contained in:
Fabien Potencier 2017-10-16 13:29:26 -07:00
commit 60adbdd059
1 changed files with 1 additions and 1 deletions

View File

@ -387,7 +387,7 @@ class PdoSessionHandler implements \SessionHandlerInterface
$this->gcCalled = false;
// delete the session records that have expired
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol + $this->timeCol < :time";
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time - $this->timeCol";
$stmt = $this->pdo->prepare($sql);
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);