@param int $max_age_in_seconds

@return void
350195
public function deleteOldSessions(int $max_age_in_seconds): void
    {
        $timestamp = Carbon::now()->subSeconds($max_age_in_seconds);

        DB::table('session')
            ->where('session_time', '<', $timestamp)
            ->delete();
    }
721606
public function gc($maxlifetime)
    {
        foreach (Kwf_Registry::get('db')->query("SELECT sessionId FROM kwf_sessions WHERE expiration < ?", time())->fetchAll() as $r) {
            $this->destroy($r['sessionId']);
        }
        return true;
    }
266768
public function setExpiredAtAttribute($value): void
    {
        if (!is_null($value) && !$value instanceof Carbon) {
            $value = Carbon::parse($value);
        }

        $this->attributes['expired_at'] = $value;
    }
60092
public function setMaxQueryTime($max)
    {
        assert(is_int($max));
        assert($max >= 0);
        $this->_maxquerytime = $max;

        return $this;
    }
225766
def max_age(self, value):
        
        option = Option()
        option.number = defines.OptionRegistry.MAX_AGE.number
        option.value = int(value)
        self.del_option_by_number(defines.OptionRegistry.MAX_AGE.number)
        self.add_option(option)
404480
public function extend($maxlifetime = 86400) {
        if ($this->factory) {
            return $this->factory->extend_lock($this, $maxlifetime);
        }
        return false;
    }
1102865
public function cleanup(DateTimeInterface $maxAge): void
    {
        $queryBuilder = $this->entityManager->createQueryBuilder();
        $queryBuilder->delete(CachedSearchResult::class, 'r')
                     ->andWhere('r.lastSearchTime < :maxAge')
                     ->setParameter('maxAge', $maxAge);

        $queryBuilder->getQuery()->execute();
    }
1286452
public function setMaxSize($max_size)
    {
        if (is_numeric($max_size)) {
            $this->max_size = $max_size;
        } else {
            $this->max_size = Util::humanReadableToBytes($max_size);
        }

        if ($this->max_size < 0 || $this->max_size == null) {
            throw new \Exception('invalid max_size value');
        }

    }
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);
        }
    }
322056
function _setRefreshTime() 
    {
        if (is_null($this->_lifeTime)) {
            $this->_refreshTime = null;
        } else {
            $this->_refreshTime = time() - $this->_lifeTime;
        }
    }
98852
private function guardValidAgeRange(Age $from = null, Age $to = null)
    {
        if ($from && $to && $from > $to) {
            throw new InvalidAgeRangeException('"from" age should not exceed "to" age');
        }
    }
940911
public function write($sessionID, $sessionData, $maxLifeTime)
    {
        Coroutine::writeFile($this->getFileName($sessionID), $sessionData, LOCK_EX);
    }
236269
public static function check(int $secondOfMinute) : void
    {
        if ($secondOfMinute < 0 || $secondOfMinute > 59) {
            throw DateTimeException::fieldNotInRange(self::NAME, $secondOfMinute, 0, 59);
        }
    }
593332
public function gc($max)
    {
        if ($this->gcLifetime !== null) {
            $max = $this->gcLifetime;
        }
        if ($max == 0) {
            return true;
        }

        $stmt = $this->db->prepare("DELETE FROM " . $this->tableName . " WHERE session_lastaccesstime < DATE_SUB(NOW(), INTERVAL " . $max . " SECOND)");
        if ($stmt->execute()) {
            return true;
        }
        return false;
    }
675957
private function setMaxSteps(int $maxSteps): void
    {
        $this->maxSteps = \max(0, $maxSteps);
        $this->stepWidth = $this->maxSteps ? Str::len($this->maxSteps) : 2;
    }
486130
public function _gc($max) {
        $old = time() - $max;
        
        ORM::for_table($this->sessions_table)->raw_execute("DELETE * FROM " . $this->sessions_table . " WHERE access < :old", ['old' => $old]);
    }
84831
public function set_lifetime($lifetime)
    {
        $this->lifetime = max(120, $lifetime);

        // valid time range is now - 1/2 lifetime to now + 1/2 lifetime
        $now = time();
        $this->now = $now - ($now % ($this->lifetime / 2));
    }