'Create a cookie object from an HTTP response.'

@classmethod
def from_http_response(cls, http_response):

    cookies = []
    response_headers = http_response.get_headers()
    for (hname, hvalue) in response_headers.iteritems():
        if ('cookie' in hname.lower()):
            cookies.append(hvalue)
    cookie_inst = cls(''.join(cookies))
    for key in ['path', 'expires', 'domain', 'max-age']:
        try:
            del cookie_inst[key]
        except:
            pass
    return cookie_inst
