[medusa] cookies

Sam Rushing rushing@n...
Mon, 15 Nov 1999 23:58:32 -0800 (PST)


wkp@c... writes:
> I've been doing some CGI scripting with Python and Medusa. It's great!
> However, I'm not sure how to set and get cookies within my server-side
> scripts. Does anyone have any examples?

You just need to monkey with the 'Cookie:' and 'Set-Cookie:' headers.
If you are using the 'persistent_script_handler', then the request
object is passed back to your module's main() function.

You can access the request headers using 'request.get_header()'
and you can set reply headers like this: request['Set-Cookie'] = "xxx"

Here's a starting reference:

http://www.netscape.com/newsref/std/cookie_spec.html

-Sam