grabbing a cookie
aleaxit at yahoo.com
Wed Oct 4 16:39:15 CEST 2000
"Jose Isaias Cabrera" <jicman at cinops.xerox.com> wrote in message
news:8radpp$hhc$1 at news.wrc.xerox.com...
> reply, msg, hdrs = h.getreply()
> for x in hdrs:
hrds is an instance of mimetools.Message, not a sequence; see
the Python Library Reference at 11.4.1 (description of the
getreply method). As 12.2.1 in the same manual explains,
you can use hdrs.headers (a sequence of lines, each with a
trailing newline) or more directly hdrs.get('Set-Cookie')
to get the content of that particular headerline.
for an example of a Python module handling cookies. That
one serves to *prepare* the Set-Cookie headerlines (for a
CGI script) rather than *decode* them back into values,
but it might still help. I think the encoding you want
to undo is quoted-printable, and I think there's a quopri.py
around somewhere in the Python standard libraries, too.
More information about the Python-list