Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: RFC 2965 cookies, cookielib, and mailman.

Reply
Thread Tools

Re: RFC 2965 cookies, cookielib, and mailman.

 
 
Titus Brown
Guest
Posts: n/a
 
      02-13-2005
For the record, re

http://mail.python.org/pipermail/pyt...er/257422.html

and

http://www.gossamer-threads.com/list.../python/380607

cheers,
--titus

----- Forwarded message from John J Lee <(E-Mail Removed)> -----

X-Original-To: http://www.velocityreviews.com/forums/(E-Mail Removed)
From: John J Lee <(E-Mail Removed)>
To: Titus Brown <(E-Mail Removed)>
Subject: Re: RFC 2965 cookies, cookielib, and mailman.
X-Spam-Status: No, hits=0.0 tagged_above=-100000.0 required=5.0 tests=
X-Spam-Level:

If you don't mind, could you forward this reply to (E-Mail Removed)
and (E-Mail Removed), for the record?

On Sun, 6 Feb 2005, Titus Brown wrote:
[...]
> -> > 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)
> ->
> -> Hmm, cookielib should work if IE and Mozilla do, so that's a bug
> -> You shouldn't need to turn on 2965 handling.
> ->
> -> Do you have a script that demonstrates the problem, so I can fix it?
>
> Attached. By the by, thanks for fixing that cookiejar bug back in

[...]
> In the attached code, just change the True/False setting of the rfc2965
> flag in the DefaultCookiePolicy and you'll see that in one case a
> cookie is correctly handled and in the other it is not. You're welcome
> to try the same URL with browsers:

[...snip details...]

Thanks for the bug report, Titus.

Damn, I wish I'd seen this bug before 2.4.0 was released.

Workaround, as you illustrate above, is to switch on RFC 2965 handling.

Looking at it, the problem seems blindingly obvious: I'm treating what is
in fact an RFC 2109 (not 2965) cookie from MailMan as though it were a
2965 cookie instead of as a Netscape cookie (a deliberate choice). This
didn't cause trouble in ClientCookie 0.4. when 2965 handling was on by
default. Now that it's off by default in cookielib and ClientCookie 1.0,
though (because 2965, and 2109 also, pretty much, are simply unimplemented
in popular browsers: ie. Firefox and MSIE), it breaks apps like Mailman
that, naively or stubbornly, send version=1 cookies. Real browsers treat
RFC 2109 cookies as Netscape cookies (which, ad-hoc as Netscape cookies
are, effectively include a few bits and pieces from the 2109 standard), so
this behaviour is just plain wrong. The fix is easy, will upload a patch
to SF.

Bah.


John

----- End forwarded message -----
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
an XML-based format with semantics like RFC 5322 (RFC 822)? Ivan Shmakov XML 3 02-13-2012 04:26 PM
Cookies and RFC 2109 mauro ASP .Net 5 07-19-2005 12:30 AM
RFC 2965 cookies, cookielib, and mailman. John J Lee Python 0 01-30-2005 10:19 PM
RFC 2965 cookies, cookielib, and mailman. C. Titus Brown Python 0 12-27-2004 08:41 PM
RFC's and acronyms G. Orme MCSE 8 01-19-2004 04:51 PM



Advertisments