update lock clucknut
All checks were successful
All checks were successful
This commit is contained in:
@@ -41,14 +41,18 @@ class MetadataBag implements SessionBagInterface
|
||||
|
||||
private int $updateThreshold;
|
||||
|
||||
private ?int $cookieLifetime;
|
||||
|
||||
/**
|
||||
* @param string $storageKey The key used to store bag in the session
|
||||
* @param int $updateThreshold The time to wait between two UPDATED updates
|
||||
* @param string $storageKey The key used to store bag in the session
|
||||
* @param int $updateThreshold The time to wait between two UPDATED updates
|
||||
* @param int|null $cookieLifetime The configured cookie lifetime; null to read from php.ini
|
||||
*/
|
||||
public function __construct(string $storageKey = '_sf2_meta', int $updateThreshold = 0)
|
||||
public function __construct(string $storageKey = '_sf2_meta', int $updateThreshold = 0, ?int $cookieLifetime = null)
|
||||
{
|
||||
$this->storageKey = $storageKey;
|
||||
$this->updateThreshold = $updateThreshold;
|
||||
$this->cookieLifetime = $cookieLifetime;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,6 +147,6 @@ private function stampCreated(?int $lifetime = null): void
|
||||
{
|
||||
$timeStamp = time();
|
||||
$this->meta[self::CREATED] = $this->meta[self::UPDATED] = $this->lastUsed = $timeStamp;
|
||||
$this->meta[self::LIFETIME] = $lifetime ?? (int) \ini_get('session.cookie_lifetime');
|
||||
$this->meta[self::LIFETIME] = $lifetime ?? $this->cookieLifetime ?? (int) \ini_get('session.cookie_lifetime');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user