def _interact(cookiejar, url, set_cookie_hdrs, hdr_name):
 from urllib2 import Request
 req = Request(url)
 cookiejar.add_cookie_header(req)
 cookie_hdr = req.get_header('Cookie', '')
 headers = []
 for hdr in set_cookie_hdrs:
  headers.append(('%s: %s' % (hdr_name, hdr)))
 res = FakeResponse(headers, url)
 cookiejar.extract_cookies(res, req)
 return cookie_hdr

def _interact ( cookiejar , url , set_cookie_hdrs , hdr_name ) : from urllib2 import Request req = Request ( url ) cookiejar . add_cookie_header ( req ) cookie_hdr = req . get_header ( 'Cookie' , '' ) headers = [ ] for hdr in set_cookie_hdrs : headers . append ( ( '%s: %s' % ( hdr_name , hdr ) ) ) res = FakeResponse ( headers , url ) cookiejar . extract_cookies ( res , req ) return cookie_hdr
perform a single request / response cycle .