Cookie Confusion - How to Set a Cookie

cbhoem at gmail.com cbhoem at gmail.com
Mon Apr 28 09:42:30 EDT 2008


Hi -

I am trying my hand at python cookies.  I'm confused about a few
things though.  Do the python cookies get written to a cookies text
file?  I have simple code below -- I see the cookie in my HTTP header
but do not get anything in the cookie text file.  I'm working on
linux.

print "Content-type: text/html"
cookie = Cookie.SimpleCookie()
cookie['Test'] = 'abc'
print cookie
print

Are there rules about where in the header the set cookie line should
be?

Thanks in advance!
Christian



More information about the Python-list mailing list