def format_cookie(url, cookies):
    """ Constructs a log message from a list of cookies and the host
    where they're set

    """
    prefix = "\n< COOKIES ({}{}) ".format(url.host(), url.path())
    suffix = ", ".join(["[[{}{}] {} => {}]".format(cookie.domain(),
                                                   cookie.path(),
                                                   cookie.name(),
                                                   cookie.value())
                        for cookie in cookies])
    return prefix + suffix