cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl cookie jars and HTTP::Cookies::Netscape perl module

From: David Byron <DByron_at_telecomsys.com>
Date: Fri, 5 May 2006 10:50:29 -0700

I'm trying to use curl's cookie jar with the HTTP::Cookies::Netscape
perl module.

I'm using curl/7.15.4-CVS on linux.

The cookiejar that curl generates for me is:

# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.

localhost FALSE /mapview FALSE 0 JSESSIONID
8D514DA1239145D16892CB7444DC4C00

When I pass this file to HTTP::Cookies::Netscape, I see the following:

[Fri May 05 10:12:02 2006] [error] [client 10.96.0.138]
HTTP::Cookies::add_cookie_header: Checking localhost.local for cookies
[Fri May 05 10:12:02 2006] [error] [client 10.96.0.138]
HTTP::Cookies::add_cookie_header: Checking .local for cookies

In other words, it's looking for cookies where the first column is
localhost.local, not localhost. From looking at RFC 2965, this seems
correct. So, I changed the cookiejar file to have localhost.local in
the first column. Now my log messages look like this:

[Fri May 05 10:30:06 2006] [error] [client 10.96.0.138]
HTTP::Cookies::add_cookie_header: Checking localhost.local for cookies
[Fri May 05 10:30:06 2006] [error] [client 10.96.0.138]
HTTP::Cookies::add_cookie_header: - checking cookie path=/mapview
[Fri May 05 10:30:06 2006] [error] [client 10.96.0.138]
HTTP::Cookies::add_cookie_header: Checking .local for cookies

But the cookie still doesn't get added to an http request using that
path...The one I'm using is:

GET http://localhost:8739/mapview/index.jsp

Here I'm getting a bit off the curl topic, but does anyone know if
there's something else that should be different in the cookie jar file
for this to work? Has anyone used curl cookie jars with the
HTTP::Cookies perl module before? If nothing else, do other folks agree
with the localhost --> localhost.local change?

Thanks for your help.

-DB
Received on 2006-05-05