def end_session_endpoint(self, request="", cookie=None, **kwargs):
        esr = EndSessionRequest().from_urlencoded(request)

        logger.debug("End session request: {}".format(esr.to_dict()))

        redirect_uri = None
        if "post_logout_redirect_uri" in esr:
            redirect_uri = self.verify_post_logout_redirect_uri(esr, cookie)
            if not redirect_uri:
                return self._error_response(
                    "Not allowed (Post logout redirect URI verification "
                    "failed)!")

        authn, acr = self.pick_auth(esr)

        sid = None
        if "id_token_hint" in esr:
            id_token_hint = OpenIDRequest().from_jwt(esr["id_token_hint"],
                                                     keyjar=self.keyjar,
                                                     verify=True)
            sub = id_token_hint["sub"]
            try:
                sid = self.sdb.get_sids_by_sub(sub)[
                    0]  # any sid will do, choose the first
            except __HOLE__:
                pass
        else:
            identity, _ts = authn.authenticated_as(cookie)
            if identity:
                uid = identity["uid"]
                try:
                    # any sid will do, choose the first
                    sid = self.sdb.uid2sid[uid][0]
                except (KeyError, IndexError):
                    pass
            else:
                return self._error_response(
                    "Not allowed (UID could not be retrieved)!")

        # if self.sdb.get_verified_logout(uid):
        #    return self.let_user_verify_logout(uid, esr, cookie, redirect_uri)

        if sid is not None:
            del self.sdb[sid]

        # Delete cookies
        headers = [authn.delete_cookie(), self.delete_session_cookie()]

        if redirect_uri is not None:
            return SeeOther(str(redirect_uri), headers=headers)

        return Response("Successful logout", headers=headers)
dataset/ETHPy150Open rohe/pyoidc/src/oic/oic/provider.py/Provider.end_session_endpoint