Querys whether or not the passed session has timed out.

@param \AppserverIo\Psr\Servlet\ServletSessionInterface $session The session to query for

@return boolean TRUE if the session has timed out, else FALSE
163143
protected function sessionTimedOut(ServletSessionInterface $session)
    {

        // we want to know what inactivity timeout we've to check the sessions for
        $inactivityTimeout = $this->getSessionSettings()->getInactivityTimeout();

        // load the sessions last activity timestamp
        $lastActivitySecondsAgo = time() - $session->getLastActivityTimestamp();

        // query whether or not an inactivity timeout has been set
        if ($inactivityTimeout < 1) {
            // if NOT, the inactivity timeout has to be higher than
            // the last activity timestamp to avoid session timeout
            $inactivityTimeout = $lastActivitySecondsAgo + 1;
        }

        // return TRUE it the last ativity timeout OR the session lifetime has been reached
        return $lastActivitySecondsAgo > $inactivityTimeout || $session->getLifetime() < time();
    }
526725
protected function hasNotBeenAdded(ResourceInterface $resource): bool
    {
        return isset($this->addedResources[$resource->getId()][$resource->getType()]) === false;
    }
544020
public function couldBePaused(TestSession $session = null)
    {
        return ($session->getState() === AssessmentTestSessionState::INTERACTING && $this->isProctored($session));
    }
276631
private function isAdvanced(PageInterface $page)
    {
        if (null !== $controller = $page->getController()) {
            if (array_key_exists($controller, $this->pageConfig['controllers'])) {
                return $this->pageConfig['controllers'][$controller]['advanced'];
            }
            throw new \RuntimeException("Undefined page controller '{$controller}'.");
        }

        return null;
    }
81802
public function hasSessionId() {
        $name = session_name();

        if (ini_get_bool('session.use_cookies'))
            if (isset($_COOKIE[$name]))
                return true;

        if (!ini_get_bool('session.use_only_cookies'))
            if (isset($_REQUEST[$name]))
                return true;

        return false;
    }
1024228
protected boolean isExpiredAt(long time) {
        try (Lock ignored = locker.lockIfNotHeld()) {
            checkValidForRead();
            return sessionData.isExpiredAt(time);
        }
    }
462739
boolean isMonitored(HttpSession session) {
		boolean monitor = false;
		if (null != session && session.getAttribute(Constants.Options.OPTIONS) != null) {
			monitor = ((Options) session.getAttribute(Constants.Options.OPTIONS)).isMonitor();
		}
		return monitor;
	}
138450
private void checkTimeoutSession() {
        if(appLastSeen <= 0) return;
        long now = System.currentTimeMillis();
        if ((now - appLastSeen) > Constants.SESSION_LENGTH_MINS * 60 * 1000) {
            getConfigLogger().verbose(getAccountId(), "Session Timed Out");
            destroySession();
            setCurrentActivity(null);
        }
    }
666873
final public function isLocked($namespace)
    {

        if (empty($namespace)) {

            return true; //just say its locked
        }
        //checks if a namespace in this session is locked
        $session = $this;
        //unlocks a namespace
        if (isset($session->registry[$namespace])) {
            return $session->registry[$namespace]->isLocked();
        }

        return false;
    }
616334
private boolean isSessionValid(final SessionData session) {
        return !sessionController.isCreatingSession() && session != null && session.getSessionId() != null && session.getAccessToken() != null;
    }
1153568
public static function isOn($exception = false)
    {
        if (isset($_SESSION)) {
            return true;
        }

        exception_if($exception, SessionSurfaceIsOffException::class);

        return false;
    }
891419
public function isPausable(TestSession $session = null)
    {
        if ($this->couldBePaused($session)) {

            /** @var AssessmentItemRef $itemRef */
            $itemRef = $session->getCurrentAssessmentItemRef();

            return $this->isItemPausable($itemRef);
        }
        return false;
    }
741777
public function session($value)
    {
        if (!isset($this->session[$value])) {
            return false;
        } else {
            return $this->session[$value];
        }
    }
503430
protected function validateSessionObject($session) {
    // Make sure some essential fields exist.
    if (is_array($session) && isset($session['access_token']) && isset($session['sig'])) {
      // Validate the signature.
      $session_without_sig = $session;
      unset($session_without_sig['sig']);

      $expected_sig = self::generateSignature(
        $session_without_sig,
        $this->getVariable('client_secret')
      );

      if ($session['sig'] != $expected_sig) {
        error_log('Got invalid session signature in cookie.');
        $session = NULL;
      }
    }
    else {
      $session = NULL;
    }
    return $session;
  }
104802
public function assertSession($session = null)
    {
        if (!($session instanceof Session)) {
            $session = $this->getSession($session);
        }

        return new WebAssert($session);
    }
1080388
protected function collectGarbage(SessionInterface $session)
    {
        $config = $this->getSessionConfig();

        if ($this->configHitsLottery($config)) {
            $lifetime = Arr::get($config, 'lifetime', 180);

            $session->getHandler()->gc($lifetime * 60);
        }
    }
134822
public function canRequest(RequestInterface $request, array $options = []) : bool
    {
        $groupCanRequest = true;
        $this->_requestLimiters->rewind();
        while ($this->_requestLimiters->valid())
        {
            /** @var RequestLimiter $requestLimiter */
            $requestLimiter = $this->_requestLimiters->current();

            $canRequest = $requestLimiter->canRequest($request, $options);
            if ($groupCanRequest && !$canRequest)
            {
                $groupCanRequest = false;
                $this->_retryAfter = $requestLimiter->getRemainingSeconds();
            }

            $this->_requestLimiters->next();
        }

        return $groupCanRequest;
    }