How to extract cookies?

Doug Fort doug.fort at verizon.net
Fri Aug 24 13:27:41 EDT 2001


Content-Transfer-Encoding: 8Bit



A wrote:



> 

> Hi,

> I use httplib module to POST to a website.From  the response(

> header)

> I need to extract cookies. Can you advise me how I can do that

> please?

> 

> 

> The header I receive looks like

> 

> Server: Microsoft-IIS/5.0

> Date: Thu, 23 Aug 2001 12:24:33 GMT

> Location: MemberPortfolio.asp

> Connection: Keep-Alive

> Content-Length: 140

> Content-Type: text/html

> Set-Cookie:

> ECEurope=Password=&Email=leads%40sendme%2Ecz;

> expires=Sun, 21-Oct-2001 23:00:00 GMT; path=/

> Set-Cookie:

> ASPSESSIONIDQQQGQLQO=ABNGDCNBDOIEFJEEPJAOJDKE;

>  path=/

> Cache-control: private

> 

> Thank you for help

> Ladislav

> 

> 

> 

> 

Hi, 



I've attched our CookieContainer class as an example. There is a Cookie 

module in the Python library, but it's mostly for server-side cookie 

handling.

-- 

Doug Fort <dougfort at dougfort.net>

http://www.dougfort.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cookiecontainer.py
Type: text/x-java
Size: 10360 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20010824/0c4baf9a/attachment.java>


More information about the Python-list mailing list