Title: doesn't save cookies
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: mcencula
Priority: normal Keywords:

Created on 2011-02-23 20:50 by mcencula, last changed 2011-02-28 14:18 by orsenthil. This issue is now closed.

File name Uploaded Description Edit mcencula, 2011-02-23 20:50 Sample code demonstrating issue
Messages (2)
msg129223 - (view) Author: Mike Cencula (mcencula) Date: 2011-02-23 20:50
I'm trying to use to save cookies from a website.  The cookie file is created with a header line, but the cookies are not stored.  Example program attached.

Python version:
2.5.2 (r252:60911, Jan 24 2010, 14:53:14)

Running on Debian lenny as a guest on Virtualbox

Output from the attached file pasted below:
mike@debian:~$ python
Here are the headers of the page :
Server: none
Content-Type: text/html
Pragma: no-cache
Cache-Control: no-cache
Expires: Tue, 04 Dec 1993 21:29:02 GMT
Vary: Accept-Encoding
Date: Wed, 23 Feb 2011 20:43:55 GMT
Transfer-Encoding:  chunked
Connection: close
Connection: Transfer-Encoding

These are the cookies we have received so far :
0   :   <Cookie BIGipServerdiy_pool=604317450.20480.0000 for>
1   :   <Cookie BIGipServerdiy_pool=637871882.20480.0000 for>
2   :   <Cookie DYN_USER_CONFIRM=1ab776eae0bf5661a2955c6ec7858439 for>
3   :   <Cookie DYN_USER_ID=1619150879 for>

Contents of cookie.lwp afterward:
mike@debian:~$ cat cookies.lwp

Behavior is nearly identical using cookielib.MozillaCookieJar except the headers are different in the saved cookie file.  Cookies themselves are not saved.

I am new to Python, so I hope this is not user error.
msg129224 - (view) Author: Mike Cencula (mcencula) Date: 2011-02-23 21:12
User error indeed.  Adding ignore_discard=True, ignore_expires=True cured the issue.

Thank you.
Date User Action Args
2011-02-28 14:18:05orsenthilsetresolution: not a bug
stage: resolved
2011-02-23 21:12:29mcenculasetstatus: open -> closed

messages: + msg129224
2011-02-23 20:50:24mcenculacreate