Skip to content

Commit

Permalink
minor #43395 [HttpFoundation] remove legacy session lifetime logic (T…
Browse files Browse the repository at this point in the history
…obion)

This PR was merged into the 6.0 branch.

Discussion
----------

[HttpFoundation] remove legacy session lifetime logic

| Q             | A
| ------------- | ---
| Branch?       | 6.0
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This part was only relevant for keeping bc with the old lifetime data. Has been forgotten to be removed in #41334 and #43120

Commits
-------

54a578b [HttpFoundation] remove legacy session lifetime logic
  • Loading branch information
fabpot committed Oct 12, 2021
2 parents a254e56 + 54a578b commit 0e258bd
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ class PdoSessionHandler extends AbstractSessionHandler
*/
public const LOCK_TRANSACTIONAL = 2;

private const MAX_LIFETIME = 315576000;

private \PDO $pdo;

/**
Expand Down Expand Up @@ -362,10 +360,9 @@ public function close(): bool
$this->gcCalled = false;

// delete the session records that have expired
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time AND $this->lifetimeCol > :min";
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time";
$stmt = $this->pdo->prepare($sql);
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
$stmt->bindValue(':min', self::MAX_LIFETIME, \PDO::PARAM_INT);
$stmt->execute();
}

Expand Down

0 comments on commit 0e258bd

Please sign in to comment.