src/Koldy/Security/Csrf.php
public static function getStoredToken(): Token
    {
        if (static::$token !== null) {
            return static::$token;
        }

        $sessionKeyName = static::getSessionKeyName();

        if ($sessionKeyName === null || strlen($sessionKeyName) == 0) {
            throw new Exception('Can not get stored CSRF token when session key is not set');
        }

        $token = Session::get($sessionKeyName);

        if ($token === null) {
            throw new SecurityException('There is no stored token on backend');
        }

        static::$token = $token;
        return $token;
    }
public static function getStoredToken(): Token
    {
        if (static::$token !== null) {
            return static::$token;
        }

        $sessionKeyName = static::getSessionKeyName();

        if ($sessionKeyName === null || strlen($sessionKeyName) == 0) {
            throw new Exception('Can not get stored CSRF token when session key is not set');
        }

        $token = Session::get($sessionKeyName);

        if ($token === null) {
            throw new SecurityException('There is no stored token on backend');
        }

        static::$token = $token;
        return $token;
    }
public static function getStoredToken ( ) : Token { if ( static :: $ token !== null ) { return static :: $ token ; } $ sessionKeyName = static :: getSessionKeyName ( ) ; if ( $ sessionKeyName === null || strlen ( $ sessionKeyName ) == 0 ) { throw new Exception ( 'Can not get stored CSRF token when session key is not set' ) ; } $ token = Session :: get ( $ sessionKeyName ) ; if ( $ token === null ) { throw new SecurityException ( 'There is no stored token on backend' ) ; } static :: $ token = $ token ; return $ token ; }
Get currently stored CSRF token from session
@return Token
@throws ConfigException
@throws Exception
@throws \Koldy\Exception
Get currently stored CSRF token from session