RFC 2965 cookies, cookielib, and mailman.

C

C. Titus Brown

Hi all,

just spent some time playing with cookielib in Python 2.4, trying
to get the cookielib example [0] to work with my mailman admindb page.
The problem was that cookies weren't getting saved.

The issue turned out to be that mailman sends out RFC 2965 [1] cookies,
which are by default rejected by cookielib. I don't remotely pretend to
understand the issues involved; hence my post ;).

A few questions for those more clued in than me:

* what is the difference between RFC 2965 cookies and others?

* why would mailman implement RFC 2965 cookies over the old format?
(I'm guessing simply because it's the latest/best/format?)

* why would cookielib NOT accept RFC 2965 cookies by default?

* my reference "good" implementation that worked with the
urllib2/cookielib is Quixote, which seems to send out
cookies in the older (Netscape?) style. Should this
be changed or updated in Quixote?

The obvious google searches found an awful lot of information but
nothing obviously pertinent.

In any case, the way to make the cookielib example work for mailman is
like so:

policy = cookielib.DefaultCookiePolicy(rfc2965=True)
cj = cookielib.LWPCookieJar('cookies.lwp', policy=policy)

thanks,
--titus

[0] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302930
[1] http://www.faqs.org/rfcs/rfc2965.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top