RFC 2965 cookies, cookielib, and mailman.

Discussion in 'Python' started by C. Titus Brown, Dec 27, 2004.

  1. 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
     
    C. Titus Brown, Dec 27, 2004
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mauro

    Cookies and RFC 2109

    mauro, Jul 18, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    808
    Scott Allen
    Jul 19, 2005
  2. michela rossi

    J2SE and MailMan - in TOMCAT 4.1.7

    michela rossi, May 12, 2004, in forum: Java
    Replies:
    0
    Views:
    450
    michela rossi
    May 12, 2004
  3. Alex Hunsley

    cookielib and urllib2: thread-safe?

    Alex Hunsley, Jan 26, 2005, in forum: Python
    Replies:
    1
    Views:
    588
    John J. Lee
    Jan 29, 2005
  4. John J Lee
    Replies:
    0
    Views:
    434
    John J Lee
    Jan 30, 2005
  5. Joshua Kugler
    Replies:
    2
    Views:
    1,042
    Joshua Kugler
    Dec 18, 2007
  6. _Who
    Replies:
    7
    Views:
    3,108
  7. Gilles Ganault

    [cookielib] How to add cookies myself?

    Gilles Ganault, Dec 16, 2008, in forum: Python
    Replies:
    0
    Views:
    671
    Gilles Ganault
    Dec 16, 2008
  8. Ivan Shmakov
    Replies:
    3
    Views:
    1,407
    Kari Hurtta
    Feb 13, 2012
Loading...