def get_cookie_value( cookiejar, name ):
    """
    Retrieves the value of a cookie from a CookieJar given its name.
    """
    value = None
    for cookie in cookiejar:
        if cookie.name == name:
            value = cookie.value
            break
    return value