def METHOD_NAME(cookie_header, secret_key):
    parsed_cookie = SimpleCookie(cookie_header)
    if "session" not in parsed_cookie:
        return {}
    cookie_interface = flask.sessions.SecureCookieSessionInterface()
    # This code matches what Flask does for encoding
    serializer = itsdangerous.URLSafeTimedSerializer(
        secret_key,
        salt=cookie_interface.salt,
        serializer=cookie_interface.serializer,
        signer_kwargs=dict(
            key_derivation=cookie_interface.key_derivation, digest_method=cookie_interface.digest_method
        ),
    )
    try:
        cookie_value = parsed_cookie["session"].value
        return serializer.loads(cookie_value)
    except itsdangerous.exc.BadSignature as e:
        # If the signature is wrong, we can still decode the cookie.
        # We try to do it properly with the actual key though, because exception
        # handling is slightly slow in Python and doing it successfully is therefore
        # faster.
        if e.payload is not None:
            try:
                return serializer.load_payload(e.payload)
            except itsdangerous.exc.BadData:
                pass
        return {}