def decode_cookie(cookie):
    '''
    This decodes a cookie given by `encode_cookie`. If verification of the
    cookie fails, ``None`` will be implicitly returned.

    :param cookie: An encoded cookie.
    :type cookie: str
    '''
    try:
        payload, digest = cookie.rsplit(u'|', 1)
        if hasattr(digest, 'decode'):
            digest = digest.decode('ascii')  # pragma: no cover
    except __HOLE__:
        return

    if safe_str_cmp(_cookie_digest(payload), digest):
        return payload
dataset/ETHPy150Open maxcountryman/flask-login/flask_login/utils.py/decode_cookie