function MemcachedSessionHandler::getCompatibleTtl
2 calls to MemcachedSessionHandler::getCompatibleTtl()
- MemcachedSessionHandler::doWrite in vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ MemcachedSessionHandler.php - MemcachedSessionHandler::updateTimestamp in vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ MemcachedSessionHandler.php
File
-
vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ MemcachedSessionHandler.php, line 77
Class
- MemcachedSessionHandler
- Memcached based session storage handler based on the Memcached class provided by the PHP memcached extension.
Namespace
Symfony\Component\HttpFoundation\Session\Storage\HandlerCode
private function getCompatibleTtl() : int {
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $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;
}