[mod_python] question - Getting/Setting Cookies

David McNab david at rebirthing.co.nz
Thu Feb 12 22:16:33 EST 2004


Bud P. Bruegger wrote:
 > maybe this is what you're looking for:
 > 
http://www.modpython.org/live/mod_python-3.1.2b/doc-html/pyapi-cookie.html

Thanks for that, Bud.

Seems that Debian's 'latest' version of mod_python, vers 2.7.10, is
downright ancient.

Thanks to Simon for earlier response re getting cookies.

A nasty hack that allows me to set cookies is:

     c = Cookie.SimpleCookie()
     c['fred']  = 'blahblah'
     ...
     cRaw = str(c)
     if cRaw:
         req.headers_out['Set-Cookie'] = cRaw.split('Set-Cookie: ', 1)[1]

Cheers
David



More information about the Mod_python mailing list