Session GC (garbage collection) handler.
Do not call this method directly.
@param integer $maxLifetime the number of seconds after which data will be seen as 'garbage' and cleaned up.
@return boolean whether session is GCed successfully
190328
public function gcSession($maxLifetime)
	{
		$this->getDbConnection()->createCommand()
			->delete($this->sessionTableName,'expire<:expire',array(':expire'=>time()));
		return true;
	}
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;
    }
499477
public function collectGarbage()
    {
        if ($this->inactivityTimeout === 0) {
            return 0;
        }
        if ($this->metaDataCache->has('_garbage-collection-running')) {
            return false;
        }

        $sessionRemovalCount = 0;
        $this->metaDataCache->set('_garbage-collection-running', true, [], 120);

        foreach ($this->metaDataCache->getIterator() as $sessionIdentifier => $sessionInfo) {
            if ($sessionIdentifier === '_garbage-collection-running') {
                continue;
            }
            $lastActivitySecondsAgo = $this->now - $sessionInfo['lastActivityTimestamp'];
            if ($lastActivitySecondsAgo > $this->inactivityTimeout) {
                if ($sessionInfo['storageIdentifier'] === null) {
                    $this->logger->warning('SESSION INFO INVALID: ' . $sessionIdentifier, $sessionInfo + LogEnvironment::fromMethodName(__METHOD__));
                } else {
                    $this->storageCache->flushByTag($sessionInfo['storageIdentifier']);
                    $sessionRemovalCount++;
                }
                $this->metaDataCache->remove($sessionIdentifier);
            }
            if ($sessionRemovalCount >= $this->garbageCollectionMaximumPerRun) {
                break;
            }
        }

        $this->metaDataCache->remove('_garbage-collection-running');
        return $sessionRemovalCount;
    }
1242219
public function gc($maxLifetime)
    {
        try {
            return (bool) $this->db->from($this->table)
                    ->where($this->columns['expires'])->lt(time())
                    ->delete();
        } catch (PDOException $e) {
            return false;
        }
    }
1278979
private static function cfgApply()
    {
        $iniMap = array(
            'gcMaxlifetime' => 'session.gc_maxlifetime',
            'gcProbability' => 'session.gc_probability',
            'gcDivisor'     => 'session.gc_divisor',
            'savePath'      => 'session.save_path',
            'useCookies'    => 'session.use_cookies',
            'useOnlyCookies'=> 'session.use_only_cookies',
        );
        foreach ($iniMap as $cfgKey => $iniKey) {
            \ini_set($iniKey, self::$cfgStatic[$cfgKey]);
        }
        \session_set_cookie_params(
            self::$cfgStatic['cookieLifetime'],
            self::$cfgStatic['cookiePath'],
            self::$cfgStatic['cookieDomain'],
            self::$cfgStatic['cookieSecure'],
            self::$cfgStatic['cookieHttponly'] // php >= 5.2.0
        );
        if (\ini_get('session.save_handler') == 'files' && !\is_dir(self::$cfgStatic['savePath'])) {
            \bdk\Debug::_warn('savePath doesn\'t exist -> creating');
            \mkdir(self::$cfgStatic['savePath'], 0700, true);
        }
        \session_cache_expire(self::$cfgStatic['cacheExpire']);
        \session_cache_limiter(self::$cfgStatic['cacheLimiter']);
        if (self::$cfgStatic['name'] != \session_name()) {
            \session_name(self::$cfgStatic['name']);
        }
        if (self::$cfgStatic['id']) {
            \bdk\Debug::_log('setting useStrictMode to false (session_id passed)');
            \ini_set('session.use_strict_mode', false);
            \session_id(self::$cfgStatic['id']);
        } else {
            \ini_set('session.use_strict_mode', self::$cfgStatic['useStrictMode']);
        }
    }
188674
public function gc($lifetime = 0)
    {
        $timeout = $this->getConfig('timeout');

        //find all sessions that are older than $timeout
        $olderThan = time() - $timeout;

        //no ack required
        $this->sessions->remove(
            array('last_accessed' => array('$lt' => new MongoDate($olderThan))),
            ( (class_exists('MongoClient')) ? (array('w'=>0)) : (array('safe'=>false)) )
        );

        return true;
    }
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;
    }
713927
public function gc($maxlifetime)
    {
        if (is_null($this->handlers)) {
            $this->seedHandlerStack();
        }

        /** @var callable $start */
        $start = $this->stacks['clean']->top();
        $this->handlerLock = true;
        $data = $start($maxlifetime);
        $this->handlerLock = false;
        return $data;
    }
1239331
protected function isFresh($destination, \DateTime $maxAge = null)
    {
        // fetch if file does not exist
        if (!file_exists($destination)) {
            return false;
        }

        // if file exists and no max-age is given, use the cached file
        if (!$maxAge instanceof \DateTime) {
            return true;
        }

        // download if ttl is passed
        $mtime = new \Datetime('@' . filemtime($destination));

        // see if cache has expired
        if ($mtime < $maxAge) {
            return false;
        }

        // check with last modified date (if available)
        if (($lastMod = $this->getLastModifiedDate()) && ($mtime < $lastMod)) {
            return false;
        }

        // all checks passed, use the cached version
        return true;
    }
1266841
public function gc($lifetime): bool
    {
        $sql = 'DELETE FROM sessions WHERE DATE_ADD(last_access, INTERVAL :seconds second) < NOW()';
        $params = ['seconds' => $lifetime];
        $this->db->delete($sql, $params);

        return true;
    }
542057
public function gc($lifetime = 1440)
	{
		// Determine the timestamp threshold with which to purge old sessions.
		$past = time() - $lifetime;

		try
		{
			$query = $this->db->getQuery(true);
			$query->delete($this->db->quoteName('#__session'))
				->where($this->db->quoteName('time') . ' < ' . $this->db->quote((int) $past));

			// Remove expired sessions from the database.
			$this->db->setQuery($query);

			return (boolean) $this->db->execute();
		}
		catch (\Exception $e)
		{
			return false;
		}
	}
281924
public function gc($maxlifetime)
    {
        $sessions = \Doctrine::getTable($this->_tableName)->findAll();
        foreach ($sessions as $session) {
            if ($this->_getExpirationTime($session) < time()) {
                $session->delete();
            }
        }

        return true;
    }
404480
public function extend($maxlifetime = 86400) {
        if ($this->factory) {
            return $this->factory->extend_lock($this, $maxlifetime);
        }
        return false;
    }
1324093
public function gc() 
	{
		$lifetime = \CCArr::get( 'lifetime', $this->_config, \CCDate::minutes( 5 ) );
		
		if ( $lifetime < ( $min_lifetime = \CCArr::get( 'min_lifetime', $this->_config, \CCDate::minutes( 5 ) ) ) )
		{
			$lifetime = $min_lifetime;
		}
		
		$this->_driver->gc( $lifetime );
	}
1072819
public function gc($maxlifetime = null)
	{
		$files = $this->files->files($this->path);

		$tm = time() - $maxlifetime;

		foreach ($files as $file)
		{
			if (!$file->isFile())
			{
				continue;
			}

			if ($file->getMTime() <= $tm)
			{
				$this->files->delete($file->getPathname());
			}
		}
	}
1191483
public function is_valid($lifetime = null, $now = null)
    {
        if (null === $now) $now = time();
        if (null === $lifetime) $lifetime = ini_get('session.gc_maxlifetime');

        return (int) $now - $this->_time < (int) $lifetime;
    }
433508
public function gc($maxlifetime)
    {
        $sessions = $this->entityManager->getRepository($this->entityName)->findAll();
        foreach ($sessions as $session) {
            if ($this->_getExpirationTime($session) < time()) {
                $this->entityManager->remove($session);
            }
        }

        try {
            $this->entityManager->flush();
            return true;
        } catch (\Doctrine\ORM\OptimisticLockException $exc) {
            return false;
        }
    }