protected function obtainTokenFromSession()
    {
        global $_SESSION;

        if (!isset($_SESSION['formsTokens'])) {
            throw new Exception('no token found', $this::ERR_NO_TOKEN);
        }

        if (!isset($_SESSION['formsTokens'][$this->formId])) {
            throw new Exception(
                'no token found for the form id '.$this->formId,
                $this::ERR_NO_TOKEN_FOR_FORM_ID
            );
        }

        return $_SESSION['formsTokens'][$this->formId];
    }