def cookieToDict(cookies: str) -> dict:
    """
    Converts a cookie string to a dict, expects the form:
    name1=value1; name2=value2; ...
    """
    finalCookies = {}
    if cookies is not None:
        cookieList = cookies.split(";")
        for cookieItem in cookieList:
            cookie = cookieItem.split("=")
            finalCookies[cookie[0].strip()] = cookie[1].strip()
    return finalCookies