[mod_python] question - Getting/Setting Cookies

Bud P. Bruegger bud at comune.grosseto.it
Thu Feb 12 10:11:42 EST 2004

Hi David,

I don't know much about mod-python--just planning to use it myself.  But 
maybe this is what you're looking for:


I came across this before and had a hell of a time finding it 
again.  Trouble seems to be that it is in the 3.1 beta version and the home 
page links to the stable manual (3.0).


At 17.26 12/02/2004 +1300, you wrote:
>I've been a longtime user of Cookie.SimpleCookie, as an easy way of 
>getting/setting cookies within Python CGI scripts.
>A couple of days ago, I installed mod_python.
>While I'm impressed with the performance gain mod_python is giving me with 
>its CGI handler, I suspect things can run faster still if I write my own 
>Only problem is - I can't see a trivial way to get a Cookie object from 
>the 'req' object which gets passed to one's mod_python handler.
>So my question is - is there any code for getting a Cookie object from the 
>'req' object?
>It's not too hard to write one - just a bit of farting about. But I'd 
>rather not 'reinvent a wheel' if someone else has already done this.
>But if I have to write it myself, here's another question - how do I get 
>the raw http headers from 'req' as a bulk string, which I can pass to 
>Thanks in advance for your help
>Kind regards
>leave this line intact so your email gets through my junk mail filter
>Mod_python mailing list
>Mod_python at modpython.org

Ing. Bud P. Bruegger, Ph.D.                 bud at comune.grosseto.it
Servizio Elaborazione Dati                    0564-488 577 (voice)
Comune di Grosseto                            0564- 21139 (fax)
Via Ginori, 43
58100 Grosseto

Collaborazione Open Source per la CIE http://www.comune.grosseto.it/cie/ 

More information about the Mod_python mailing list