[issue2007] cookielib lacks FileCookieJar class for Internet Explorer

John J Lee report at bugs.python.org
Wed Oct 15 22:12:53 CEST 2008


John J Lee <jjlee at users.sourceforge.net> added the comment:

Note that the code on wwwsearch.sf.net only reads cookies, and does not
write them.  Also, the approach used is fragile to changes to MS's
"index.dat" database, which was the reason why that code was not
included when cookielib was added.  As far as I know, the index.dat
format is not specified and is subject to change or removal by MS.  It's
possible that that MSIE cookiejar is already broken on Windows Vista,
for example, since I have never tested it on that platform.

An alternative approach that should allow writing cookies would be to
use InternetGetCookie / InternetSetCookie API:

http://msdn.microsoft.com/en-us/library/aa384710(VS.85).aspx

A *sketch* of that approach (which I'm not going to implement properly)
is here:

http://codespeak.net/svn/wwwsearch/mechanize/trunk/attic/MSIEDBCookieJar.py

The other, fragile (but working, at least on some MS OSes) approach:

http://codespeak.net/svn/wwwsearch/mechanize/trunk/mechanize/_msiecookiejar.py

----------
nosy: +jjlee

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2007>
_______________________________________


More information about the Python-bugs-list mailing list