[twill] Loading cookies (was Re: cookie client)

Titus Brown titus at caltech.edu
Fri Aug 4 10:07:38 PDT 2006

-> Titus -- why not have twill's load_cookies load the IE cookies if you're 
-> running on Windows and there's no cookie jar argument (by instantiating an 
-> MSIECookieJar and using .load_from_registry())?  That's the preferred way 
-> to load IE cookies (always assuming that MSIECookieJar still works -- it 
-> parses an undocumented MS file format...).  If there's an argument, I 
-> think twill should attempt to .load() using each class in turn -- 
-> LoadError tells you it's the wrong format for that class (MSIECookieJar, 
-> MozillaCookieJar, LWPCookieJar -- order shouldn't matter).  If you add 
-> support for Firefox cookie saving, you should also add the warnings about 
-> this from the mechanize docs (IIRC, that a running Firefox may clobber 
-> your changes, and you should back up any cookie files that contain 
-> important cookies).  I think save_cookies without an argument should use 
-> the filename and file format that were used on the previous load_cookies. 
-> Finally, note MSIECookieJar does not support saving, and iteration won't 
-> cause loading of cookies unless .delayload is true.  The delayload thing 
-> can be significant for MSIECookieJar because each cookie is in its own 
-> little file (or something similar, I forget), so I suggest having 
-> delayload=False until somebody asks for show_cookies, at which point you 
-> should call .load_all_cookies() before iterating.

Hi, John,

I'll try implementing this in an extension module to see how it works


More information about the twill mailing list