send cookie on request with urllib2

Kent Johnson kent at kentsjohnson.com
Thu Apr 20 17:40:59 EDT 2006


itay_k wrote:
> Hi,
> 
> I dont understand why this is so complicated, just to add one line of
> cookie header on the GET request.
> 
> This is my unworking code:
> import time
> import Cookie
> import cookielib, urllib2
> 
> c= cookielib.Cookie(1,"Name","Tom", 80,False, "itay", False, False,
> "d:\\asddd",False, False,time.time()+1000,False,None,None,None)

    ^^^^ path is the server path to which the cookie applies. Try '/'.

Kent



More information about the Python-list mailing list