[mod_python] Cookie patch

Nicolas Lehuen nicolas.lehuen at gmail.com
Thu Jan 13 15:45:18 EST 2005


I wrote :
> I wrote a few tests and I checked that the new function does follow
> this interpretation of the RFC. The problem is that I'm not 100% sure
> that it's meant to be interpreted this way... I'll check in other
> Cookies implementations (in Python or Java) to make sure.

See the getCookies() method in :

http://cvs.sourceforge.net/viewcvs.py/jetty/Jetty/src/org/mortbay/http/HttpRequest.java?rev=1.85&view=markup

This is from Jetty (http://jetty.mortbay.org/jetty/index.html), a
pretty nice HTTP server written in 100% Java, with nearly 7 years of
history...

The code uses the $version header if available as front attribute.
Other front attributes are ignored. The $path and $domain attributes
are parsed and applied to the rightmost preceding cookie. Other
attributes are just ignored

So judging from Jetty's implementation, this new parsing function does the job.

If you're OK with it I'll commit it in Subversion.

Regards,
Nicolas


More information about the Mod_python mailing list