N°6002 - Explicitly add symfony/http-foundation and symfony/http-kernel to composer.json for easier lib update

This commit is contained in:
Molkobain
2023-02-22 22:38:15 +01:00
parent d997e36de0
commit 826fbe10c8
28 changed files with 262 additions and 144 deletions

View File

@@ -77,7 +77,7 @@ class MemcachedSessionHandler extends AbstractSessionHandler
#[\ReturnTypeWillChange]
public function updateTimestamp($sessionId, $data)
{
$this->memcached->touch($this->prefix.$sessionId, time() + (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime')));
$this->memcached->touch($this->prefix.$sessionId, $this->getCompatibleTtl());
return true;
}
@@ -87,7 +87,20 @@ class MemcachedSessionHandler extends AbstractSessionHandler
*/
protected function doWrite(string $sessionId, string $data)
{
return $this->memcached->set($this->prefix.$sessionId, $data, time() + (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime')));
return $this->memcached->set($this->prefix.$sessionId, $data, $this->getCompatibleTtl());
}
private function getCompatibleTtl(): int
{
$ttl = (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime'));
// If the relative TTL that is used exceeds 30 days, memcached will treat the value as Unix time.
// We have to convert it to an absolute Unix time at this point, to make sure the TTL is correct.
if ($ttl > 60 * 60 * 24 * 30) {
$ttl += time();
}
return $ttl;
}
/**