Question about using cookielib in python 2.4

M

Marko.Cain.23

Hi,
I am following the example of Python cookbook (14.7) about using
cookielib in python2.4

cj = cookielib.LWPCookieJar()
//.... code to send out the request
print "Coookie-------------------------"
if cj is not None:
for index, cookie in enumerate(cj):
print index, ': ' , cookie
cj.save(COOKIEFILE)

My question is I see cookie being printed in the above code,
but when I do a 'more ' of the Cookie file, it is empty?

This is what I see on the screen:

Coookie-------------------------
0 : <Cookie Test-ID=swmfp2caw065kswg for .vision5.abc.com/>

but when I more the 'cookie file', it is empty?

$ more cookies.lwp
#LWP-Cookies-2.0
$
 
J

John J. Lee

Hi,
I am following the example of Python cookbook (14.7) about using
cookielib in python2.4

cj = cookielib.LWPCookieJar()
//.... code to send out the request
print "Coookie-------------------------"
if cj is not None:
for index, cookie in enumerate(cj):
print index, ': ' , cookie
cj.save(COOKIEFILE)

My question is I see cookie being printed in the above code,
but when I do a 'more ' of the Cookie file, it is empty?

This is what I see on the screen:

Coookie-------------------------
0 : <Cookie Test-ID=swmfp2caw065kswg for .vision5.abc.com/>

but when I more the 'cookie file', it is empty?

$ more cookies.lwp
#LWP-Cookies-2.0
$

I think I can guess, but post the code and I'll tell you for sure (if
it's the same as V1 of the cookbook, all the code is BSD license, so
you're at liberty to do so).


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,181
Latest member
RexGreenwa
Top