private function verifyState($state)
    {
        $this->logger->debug('Verify parameter state.');
        $state = urldecode($state);
        $stateArray = [];
        parse_str($state, $stateArray);
        $token = $stateArray['token'];
        $token = preg_replace('~{~', '', $token, 1);
        $token = preg_replace('~}~', '', $token, 1);
        
        if ($token != $this->session->get(static::OPENID_SESSION_TOKEN)) {
            $this->logger->error('The value of the parameter STATE is not equal to the one which is expected');
            throw new SecurityException("The token is invalid.");
        }
    }
private function verifyState($state)
    {
        $this->logger->debug('Verify parameter state.');
        $state = urldecode($state);
        $stateArray = [];
        parse_str($state, $stateArray);
        $token = $stateArray['token'];
        $token = preg_replace('~{~', '', $token, 1);
        $token = preg_replace('~}~', '', $token, 1);
        
        if ($token != $this->session->get(static::OPENID_SESSION_TOKEN)) {
            $this->logger->error('The value of the parameter STATE is not equal to the one which is expected');
            throw new SecurityException("The token is invalid.");
        }
    }
private function verifyState ( $ state ) { $ this -> logger -> debug ( 'Verify parameter state.' ) ; $ state = urldecode ( $ state ) ; $ stateArray = [ ] ; parse_str ( $ state , $ stateArray ) ; $ token = $ stateArray [ 'token' ] ; $ token = preg_replace ( '~{~' , '' , $ token , 1 ) ; $ token = preg_replace ( '~}~' , '' , $ token , 1 ) ; if ( $ token != $ this -> session -> get ( static :: OPENID_SESSION_TOKEN ) ) { $ this -> logger -> error ( 'The value of the parameter STATE is not equal to the one which is expected' ) ; throw new SecurityException ( "The token is invalid." ) ; } }
Check state parameter for security reason.

@param $state

@throws SecurityException
Check state parameter for security reason .