from typing import OrderedDict


def parse_cookie_like_string(cookie_str):
    """
        Decode cookie_str, return an ordered dict from '=' and '&' separated string.
        For example: "foo=bar&baz=qux&zap=zazzle" will return
        { "foo":"bar", "baz":"qux", "zap":"zazzle" }
    """
    d = OrderedDict()
    arr = cookie_str.split('&')

    for s in arr:
        # strings of "key=value"

        # Choose one: Force to properly paired (slightly more difficult), or ...
        key, value = s.split('=')
        d[key] = value

        # allow incorrect encoding -- discard malformed strings instead of throwing errors
        # arr = s.split('=')
        # if len(arr) == 2:
        #    d[arr[0]] = arr[1]

    return d