diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php index b07a955da3f5d..7b9785dbce9d6 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php @@ -50,7 +50,7 @@ public function __construct(\Redis|\RedisArray|\RedisCluster|\Predis\ClientInter $this->redis = $redis; $this->prefix = $options['prefix'] ?? 'sf_s'; - $this->ttl = $options['ttl'] ?? null; + $this->setTtl($options['ttl'] ?? null); } /** @@ -110,4 +110,9 @@ public function updateTimestamp(string $sessionId, string $data): bool { return $this->redis->expire($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime'))); } + + public function setTtl(?int $ttl): void + { + $this->ttl = $ttl; + } }