Tests if current action requires session

@return bool
182163
protected function _isSessionRequiredAction()
    {
        foreach ($this->_getRequireSessionWithParams() as $sParam => $aValues) {
            $sValue = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sParam);
            if (isset($sValue)) {
                if (is_array($aValues)) {
                    if (isset($aValues[$sValue]) && $aValues[$sValue]) {
                        return true;
                    }
                } elseif ($aValues) {
                    return true;
                }
            }
        }

        return (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST');
    }
1022061
private function session()
    {
        if ($this->session === null) {
            $this->session = DI::getInstance()->get('session');
        }

        return $this->session;
    }
156370
public function validateRequest(): bool
    {
        if ($this->useNativeSession) {
            if (!isset($_SESSION[$this->sessionIndex])) {
                return false;
            }
            /** @var array<string, array<string, mixed>> $sess */
            $sess =& $_SESSION[$this->sessionIndex];
        } else {
            if (!isset($this->session[$this->sessionIndex])) {
                return false;
            }
            /** @var array<string, array<string, mixed>> $sess */
            $sess =& $this->session[$this->sessionIndex];
        }

        if (
            empty($this->post[$this->formIndex]) ||
            empty($this->post[$this->formToken])
        ) {
            // User must transmit a complete index/token pair
            return false;
        }

        // Let's pull the POST data
        /** @var string $index */
        $index = $this->post[$this->formIndex];
        /** @var string $token */
        $token = $this->post[$this->formToken];
        if (!\is_string($index) || !\is_string($token)) {
            return false;
        }

        if (!isset($sess[$index])) {
            // CSRF Token not found
            return false;
        }

        if (!\is_string($index) || !\is_string($token)) {
            return false;
        }

        // Grab the value stored at $index
        /** @var array<string, mixed> $stored */
        $stored = $sess[$index];

        // We don't need this anymore
        if ($this->deleteToken($sess[$index])) {
            unset($sess[$index]);
        }

        // Which form action="" is this token locked to?
        /** @var string $lockTo */
        $lockTo = $this->server[$this->lock_type];
        if (\preg_match('#/$#', $lockTo)) {
            // Trailing slashes are to be ignored
            $lockTo = Binary::safeSubstr(
                $lockTo,
                0,
                Binary::safeStrlen($lockTo) - 1
            );
        }

        if (!\hash_equals($lockTo, (string) $stored['lockTo'])) {
            // Form target did not match the request this token is locked to!
            return false;
        }

        // This is the expected token value
        if ($this->hmac_ip === false) {
            // We just stored it wholesale
            /** @var string $expected */
            $expected = $stored['token'];
        } else {
            // We mixed in the client IP address to generate the output
            /** @var string $expected */
            $expected = Base64UrlSafe::encode(
                \hash_hmac(
                    $this->hashAlgo,
                    isset($this->server['REMOTE_ADDR'])
                        ? (string) $this->server['REMOTE_ADDR']
                        : '127.0.0.1',
                    (string) Base64UrlSafe::decode((string) $stored['token']),
                    true
                )
            );
        }
        return \hash_equals($token, $expected);
    }
797556
public function isRemoteCheckRequired()
    {
        if ($this->uid && $this->sessionToken && $this->recheck) {
            if($this->recheck > (new DateTime('NOW'))) {
                return false;
            }
        }

        return true;
    }
1029203
public static function valid() {
		if (static::start() && static::read('Config')) {
			if (static::_validAgentAndTime() && static::$error === false) {
				static::$valid = true;
			} else {
				throw new InternalErrorException('Session Highjacking Attempted !!!');
			}
		}
		return static::$valid;
	}
768776
public function initSession ()
	{
		
		// Get session
		
		$session	= $this->getSessionData ();
		
		// Check session is valid
		
		if ($this->checkSession ($session) !== TRUE)
		{
			return $this->Logout ('invalid_session');
		}
		
		// Load user from session
		
		$this->fromSessionData ();
		
		// Read user

		if (!$this->Read ())
		{
			return $this->Logout ('user_read_error');
		}
		
		// Reset password
		
		$this->reset ('password');
		
		// If the user is not active or the active status has changed
		
		if ($session['active'] != $this->iget ('active') || !$this->iget ('active'))
		{
			return $this->Logout ('inactive');
		}
		
		// Check if the session has timed out
		
		if ($this->session ()->timedOut ($session['last_action']))
		{
			return $this->Logout ('timeout');
		}
		
		// Update action time
		
		$this->updateLastAction ();
		
		// Set login status
		
		$this->loggedIn	= TRUE;
		
		// Redirect to originally requested URL
		
		if ($this->session ()->get ('requested_url'))
		{
			$url = $this->session ()->get ('requested_url');
			$this->session ()->set ('requested_url', FALSE);
			new Redirect ($url);
		}
		
		// return TRUE
		
		return TRUE;
		
	}
1004316
private function isAuthorized() {

        /**
         * Use $permitted to insert name of pages that do not require authentication
         */
        $permitted = ['login', 'logout'];
        if (isset($this->request->pass[0]))
            if (in_array($this->request->pass[0], $permitted))
                return TRUE;

        /**
         * Check if the user is authenticated
         */
        if ($this->request->session()->check('User.id'))
            return TRUE;

        /**
         * Default rule
         */
        return TRUE;
    }
20568
protected function checkStarted(): bool
    {
        if (!$this->started) {
            $this->started = self::sessionStart();
        }
        if (isset($_SESSION[$this->namespace]) && !is_array($_SESSION[$this->namespace])) {
            $_SESSION[$this->namespace] = [];
        }
        return (bool) $this->started;
    }
681930
public function isActiveSession()
    {
        // Check if session timeout is defined in application settings
        $sessionConfig = $GLOBALS['app']->getConfiguration()->getRawConfiguration('session');
        if (!empty($sessionConfig) && isset($sessionConfig['timeout']) && !empty($sessionConfig['timeout'])) {
            $sessionTimeout = $sessionConfig['timeout'];
        } else {
            $sessionTimeout = SESSION_TIMEOUT;
        }

        file_put_contents(getcwd().'/logs/session.log', print_r($_SESSION, 1));

        if(isset($_SESSION[self::GLOBAL_PREFIX.'last_accessed']) &&
            (time() - $_SESSION[self::GLOBAL_PREFIX.'last_accessed'] > $sessionTimeout)) {
            return FALSE;
        }

        return TRUE;
    }
255961
public function isLoggedIn()
    {
        if ($this->instance instanceof \Phavour\Session\Storage) {
            if ($this->instance->get('identity') != false) {
                return true;
            }
        }

        return false;
    }
808190
protected function hasAccess()
    {
        return $this->module->password == Yii::$app->session->get(self::STYLEGUIDE_SESSION_PWNAME, false);
    }
1069954
protected function _isActionEnabled() {
		$actions = $this->getConfig('actions');
		if (!$actions) {
			return true;
		}

		return in_array($this->getController()->getRequest()->getParam('action'), $actions, true);
	}
611272
public function hasActiveSession()
    {
        $cookie = $this->app['cookie'];

        return $cookie->has($this->config->get('concrete.session.name')) || $cookie->has('ccmAuthUserHash');
    }
955291
public function sessionStart()
    {
        if ( $this->storage && !$this->storage->isStarted() )
        {
            $this->storage->start();
        }

        return true;
    }
68009
public function doLogout(): bool
    {
        // No user logged in
        if (empty($this->session['user'])) {
            return true;
        }

        // Store current user id for later use
        $user = $this->session['user'];

        // Remove autologin stuff?
        if ($this->remember) {
            $autologin = new Autologin($this->db);
            $autologin->setCookieName($this->cookie_name);
            $autologin->removeAutoLoginTokenAndCookie($user);
        }

        // Refresh session id and delete old session
        session_regenerate_id(true);

        // Clean up session
        unset($this->session['autologin_failed']);

        $this->session['user'] = 0;
        $this->session['logged_in'] = false;

        if (isset($this->logger)) {
            $this->logger->info('Logout: User [' . $user . ']');
        }

        return true;
    }
449359
protected function validSession(): bool
    {
        if (
            !array_key_exists(self::CLIENT_SIGNATURE, $_SESSION)
            || !array_key_exists(self::SESSION_CREATED, $_SESSION)
        ) {
            //Missing session signature or timestamp!
            return false;
        }

        if ($_SESSION[self::SESSION_CREATED] < time() - $this->lifetime) {
            //Session expired
            return false;
        }

        if (!hash_equals($_SESSION[self::CLIENT_SIGNATURE], $this->clientSignature)) {
            //Signatures do not match
            return false;
        }

        return true;
    }
264636
public static function check()
    {
        if (Session::has(self::ENVIRONMENT_NAME)) {
            return true;
        }

        Session::forget(self::ENVIRONMENT_NAME);
        return false;
    }