Checks if the token is expired comparing
with the given lifetime.

@param int $lifetime The lifetime of the token

@return bool
428239
public function isExpired($lifetime)
    {
        $interval = $this->createdOn->diff(new \DateTimeImmutable());

        return $interval->s >= (int) $lifetime;
    }
1324396
public function has(string $key): bool
    {
        if (isset($this->cache[$key])) {
            $expire = (int)$this->cache[$key]['ttl'];
            return $expire === 0 || time() < $expire;
        }

        return false;
    }
602713
public function isExpired() : bool
    {
        return $this->getExpiryAttribute()->timestamp < Carbon::now()->timestamp
            && $this->length !== 0
            && !$this->isRemoved();
    }
604242
public function checkAccessTokenExpired()
    {
        // don't have the data? Let's assume the token has expired
        if (!isset($this->token['created_at']) || !isset($this->token['expires_in'])) {
            return true;
        }

        return ($this->token['created_at'] + $this->token['expires_in']) < time();
    }
52917
public function purge($lifetime = LibSessionsDomainEntitySession::MAX_LIFETIME, $guestOnly = true)
    {
        $past = time() - $lifetime;

        $query = $this->getQuery()->delete()->where('time < '.$past);

        if ($guestOnly) {
            $query->where('guest', '=', 1);
        }

        return (boolean) $this->getStore()->execute($query);
    }
698298
public function isCredentialsNonExpired()
    {
        if (true === $this->credentialsExpired) {
            return false;
        }

        if (null !== $this->credentialsExpireAt && $this->credentialsExpireAt->getTimestamp() < time()) {
            return false;
        }

        return true;
    }
539943
public function expireToken($token)
    {
        $tokenData = $this->getTokenData($token);
        if ($tokenData == false) {
            return false;
        }

        $tokenData->date_of_expiry = time() - 1;
        return $tokenData->save();
    }
664206
public function setLifetime($lifetime)
    {
        $lifetime = intval($lifetime);

        if ($lifetime < 1 || $lifetime > 44640) {
            throw new InvalidArgument('Valid value ranges between 1 minute and 31 days given in minutes');
        }

        $this->lifetime = $lifetime;

        return $this;
    }
72686
public function remember($lifetime = null)
    {
        $this->shouldCache = true;

        // Make sure something other than the default value (null) is given.
        // Then resolve the DateTime instance from the given value.
        if ($lifetime !== null) {
            $this->cacheLifetime = $this->resolveCacheLifetime($lifetime);
        }

        return $this;
    }
912470
protected function getRealLifetime($lifetime): int
    {
        if (null === $lifetime) {
            $lifetime = $this->defaultLifetime;
        }
        if (0 === $lifetime || $lifetime > $this->maximumLifetime) {
            $lifetime = $this->maximumLifetime;
        }

        return (int)$lifetime;
    }
423497
public function gc($lifeTime = 0)
    {
        if (Config::get('session_user_loc') == 'db') {
            $lifeTime || $lifeTime = $this->lifeTime;
            $this->handler->whereLt('ctime', Cml::$nowTime - $lifeTime)
                ->delete(Config::get('session_user_loc_table'), true, Config::get('session_user_loc_tableprefix'));
        } else {
            //cache 本身会回收
        }
        return true;
    }
208955
protected function expired($session)
    {
        return isset($session->last_activity) &&
            $session->last_activity < Carbon::now()->subMinutes($this->minutes)->getTimestamp();
    }
1275198
public function isExpired()
    {
        if (null === $this->created || 0 === $this->lifetime) {
            throw new \LogicException(
                'Cannot define if token is expired, created datetime or/and lifetime are missing.'
            );
        }

        return time() > strtotime($this->created) + $this->lifetime;
    }
271257
public function isExpired($time = null)
    {
        $time = ((null === $time) ? time() : $time);
        return (($this->_options['expire'] - $time) > 0);
    }
1096077
private function isTokenNotExpired($token)
    {
        $payload = $this->getPayload($token);

        return isset($payload[self::EXP_KEY]) && $payload[self::EXP_KEY] > (new \DateTime())->getTimestamp();
    }
708254
public function checkToken($token)
    {
        return (bool) $this->token()->where('token', $token)->where('expiration_date', '>', Carbon::now())->count();
    }
34354
public function deleteExpiredTokens()
    {
        $lifetime = config('autologin.lifetime');

        $expiry = Carbon::now()->subMinutes($lifetime);

        return $this->provider->deleteExpiredTokens($expiry);
    }