How to correctly set a cookie value in headers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ravenchild
    New Member
    • May 2012
    • 2

    How to correctly set a cookie value in headers

    Maybe you will help me in this "simple" case:

    Code:
    request2 = urllib.request.Request(url)
    cj2 = http.cookiejar.CookieJar()
    urlOpener2 = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj2))
    url2 = urlOpener2.open(request2)
    allinfo2 = url2.info()
    Output of this script is on this image: http://img195.imageshack.us/img195/9...0523110058.png My question is: How I can add new element to headers ?? something like that ('Set-Cookie',"server =2")
Working...