How do I handle setting the cookies file in a CGI?

John Draper crunch at webcrunchers.com
Sat Oct 28 06:17:38 EDT 2000


Hi,

I want to set a cookie in my CGI,   to pass information from page to page.
I want to set a cookie called "usercode" to some value....

It is my understanding that I Have to send this back to tbe browser from
my CGI.

Set-Cookie: usercode=ty654etyh;

I tried sending this in various ways....    but I'm not sure if I send this
BEFORE or AFTER sending the....   Content-Type: text/html\n

I tried either way,   but not sure if it's working.    How can I test it?

I don't have the Cookie.py module in my Ver 1.5.2 of python,   and I cannot
upgrade right now,  because I'm in middle of the project.

John






More information about the Python-list mailing list