def cookie_decode(data, key):
    data = tob(data)
    if cookie_is_encoded(data):
        sig, msg = data.split(tob('?'), 1)
        if _lscmp(sig[1:], base64.b64encode(hmac.new(tob(key), msg).digest())):
            return pickle.loads(base64.b64decode(msg))
    return None
Verify and decode an encoded string. Return an object or None.
dataset/ETHPy150Open adampresley/bottlepy-bootstrap/app/bottle.py/cookie_decode