def METHOD_NAME(self) -> bool:
    """Check optional state parameter."""
    stored = self.request.session.get(self.session_key, None)
    returned = self.get_request_arg("state", None)
    check = False
    if stored is not None:
        if returned is not None:
            check = constant_time_compare(stored, returned)
        else:
            LOGGER.warning("No state parameter returned by the source.")
    else:
        LOGGER.warning("No state stored in the session.")
    return check