Control the lifetime against min and max lifetime if provided.

@param int $lifetime

@return int
321001
public function getControledLifetime($lifetime)
    {
        if (
            null !== $this->_instance_options['min_lifetime']
            && $this->_instance_options['min_lifetime'] > $lifetime
        ) {
            $lifetime = $this->_instance_options['min_lifetime'];
        } elseif (
            null !== $this->_instance_options['max_lifetime']
            && $this->_instance_options['max_lifetime'] < $lifetime
        ) {
            $lifetime = $this->_instance_options['max_lifetime'];
        }

        return $lifetime;
    }
686378
public function clean($maxlifetime, $next)
    {
        $status = $this->handler->gc($maxlifetime);
        return $next($maxlifetime) && $status;
    }
1186261
protected function resolveCacheLifetime($lifetime): DateTime
    {
        if ($lifetime instanceof DateTime) {
            return $lifetime;
        }

        if (is_int($lifetime)) {
            return Carbon::now()->addMinutes($lifetime);
        }
    }
419350
public function getLifetime()
    {
        if ($this->lifetime === null) {
            $this->lifetime = $this->config->get('system.cache.lifetime') ?: 604800; // 1 week default
        }

        return $this->lifetime;
    }
1073232
public function gc($maxlifetime)
    {
        $sql = 'DELETE FROM ' . $this->config['name']
            . ' WHERE ' . $this->config['modifiedColumn'] . ' + ' . $this->config['lifetimeColumn'] . ' < ?';

        $this->query($sql, array(time()));

        return true;
    }
812786
public function gc(int $maxlifetime) : bool
    {
        static $stmt;
        if (!isset($stmt)) {
            $stmt = $this->pdo->prepare(
                "DELETE FROM cesession_session WHERE dateactive < ?"
            );
        }
        $stmt->execute([date('Y-m-d H:i:s', strtotime("-$maxlifetime second"))]);
        return ($affectedRows = $stmt->rowCount()) && $affectedRows;
    }
1372249
public function getMaxAge()
    {
        $cache_control = $this->getCacheControl();

        if (isset($cache_control['max-age'])) {
            $result = $cache_control['max-age'];
        } else {
            $result = (int) $this->_max_age;
        }

        return (int) $result;
    }
537043
private function assignSessionLifetime()
    {
        if (isset($this->configurations['lifetime'])) {
            $lifetime = $this->configurations['lifetime'];
            ini_set('session.gc_maxlifetime', $lifetime * 1.2);
            session_set_cookie_params($lifetime);
        }
    }
764892
public function countByValue($min = '-inf', $max = '+inf'): int
    {
        return $this->handle->zCount($this->name, strval($min), strval($max));
    }
62876
public function getMaxAge()
    {
        if (isset($this->headers['cache-control']) &&
            ($value = $this->getInlineValue($this->headers['cache-control'], 'max-age', ',')) !== false
        ) {
            return intval($value);
        }
        return 0;
    }
810532
public function gc($maxLifeTime = 1440): bool
    {
        foreach (\glob($this->savePath.DIRECTORY_SEPARATOR.'sess_*') as $file) {
            if (\file_exists($file) && \filemtime($file) + $maxLifeTime < \time()) {
                @\unlink($file);
            }
        }
        return true;
    }
911604
public function maxAge($maxAge = null)
    {
        if (func_num_args() === 0) {
            return $this->_data['max-age'];
        }
        return $this->_data['max-age'] = $maxAge === null ?  $maxAge : (integer) $maxAge;
    }
381337
public function getLifetime($regionName)
    {
        return isset($this->lifetimes[$regionName])
            ? $this->lifetimes[$regionName]
            : $this->defaultLifetime;
    }
440944
protected function getLifetime()
    {
        $params = session_get_cookie_params();
        $cookieLifetime = (int)$params['lifetime'];
        $gcLifetime = (int)ini_get('session.gc_maxlifetime');

        return $cookieLifetime ? min($cookieLifetime, $gcLifetime) : $gcLifetime;
    }
95883
public function gc($maxlifetime)
    {
        $this->pdo->queryWithParam(
            'DELETE FROM session WHERE last_update < DATE_SUB(NOW(), INTERVAL :maxlifetime SECOND)',
            [[':maxlifetime', $maxlifetime, \PDO::PARAM_INT]]
        );

        return $this->pdo->getLastOperationStatus();
    }
1083990
public function lifetime($value)
    {
        foreach ($this->candidates as $categorizer) {
            $result = $categorizer->lifetime($value);
            if ($result !== null) {
                return $result;
            }
        }

        return $this->defaultLifetime instanceof DateTime
                ? $this->defaultLifetime
                : (new DateTime())->modify($this->defaultLifetime);
    }
568534
public function gc($maxlifetime)
    {
        foreach ($this->sessions as $session_id => $content) {
            if ($this->sessions[$session_id]['time'] <= $this->createTimestamp()) {
                $this->destroy($session_id);
            }
        }

        return true;
    }