Skip to content

Commit 0b79625

Browse files
Merge branch '4.4' into 5.0
* 4.4: (30 commits) [Security] Check UserInterface::getPassword is not null before calling needsRehash gracefully handle missing event dispatchers Fix TokenStorage::reset not called in stateless firewall [DotEnv] Remove `usePutEnv` property default value [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists Set up typo fix [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass [Cache] fix memory leak when using PhpArrayAdapter [Validator] Allow underscore character "_" in URL username and password [TwigBridge] Update bootstrap_4_layout.html.twig [FrameworkBundle][SodiumVault] Create secrets directory only when needed fix parsing negative octal numbers [SecurityBundle] Passwords are not encoded when algorithm set to \"true\" [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass do not validate passwords when the hash is null [DI] fix resolving bindings for named TypedReference [Config] never try loading failed classes twice with ClassExistenceResource [Mailer] Fix SMTP Authentication when using STARTTLS [DI] Fix making the container path-independent when the app is in /app ...
2 parents 83eb54b + 1f70ac4 commit 0b79625

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Session/Storage/Handler/RedisSessionHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct($redis, array $options = [])
6363

6464
$this->redis = $redis;
6565
$this->prefix = $options['prefix'] ?? 'sf_s';
66-
$this->ttl = $options['ttl'] ?? (int) ini_get('session.gc_maxlifetime');
66+
$this->ttl = $options['ttl'] ?? null;
6767
}
6868

6969
/**
@@ -79,7 +79,7 @@ protected function doRead(string $sessionId): string
7979
*/
8080
protected function doWrite(string $sessionId, string $data): bool
8181
{
82-
$result = $this->redis->setEx($this->prefix.$sessionId, $this->ttl, $data);
82+
$result = $this->redis->setEx($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')), $data);
8383

8484
return $result && !$result instanceof ErrorInterface;
8585
}
@@ -115,6 +115,6 @@ public function gc($maxlifetime): bool
115115
*/
116116
public function updateTimestamp($sessionId, $data)
117117
{
118-
return (bool) $this->redis->expire($this->prefix.$sessionId, $this->ttl);
118+
return (bool) $this->redis->expire($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')));
119119
}
120120
}

0 commit comments

Comments
 (0)