I am trying to set a cookie in a netscape cookie_jar because I want to 
copy to my browser the state of some cookies for URLs which I have 
visited some other way. I have a hash of key/values for a given domain 
(path is always "/" port etc undefined).

My problem is with the expiry time (and the discard field?) because the 
cookies are always reported ot have an expiry of jan 1 1900. I have 
tried setting the maxage parameter to 1 day (86400 secs) with change in 
effect so I'm confused.

my    $cookie_jar = HTTP::Cookies::Netscape->new(file => 
"/results/cookies.txt", autosave => 1);

for (keys %cc) {
$cookie_jar->set_cookie(0,$_,$cc{$_}, '/', $dom, '', '', '', 2001, 1);
}

print $cookie_jar->as_string();

result is
Set-Cookie3: 
EPClubCookie="_$_K8qRg6enW.olfSvih4brJkp1wWvB6Hps_$_ieprod_$__$_"; 
path="/"; domain=".chemweb.com"; expires="2026-12-31 12:05:32Z"; version=0
Set-Cookie3: 
cookie="/images/ochi-097f.JPG%26%23ffff00%26%23fedcba%26%23ff00FF"; 
path="/"; domain=localhost; expires="1900-01-00 00:00:00Z"; version=0

The first cookie is already in the cookie jar and it works. The second 
one I am adding.

When I look at cookies.txt I also notice that the second cookie has a 
FALSE in the seocnd column compared to a TRUE for the exsiting cookie, 
is this related?


..chemweb.com    TRUE    /       FALSE   1798718732      EPClubCookie 
_$_K8qRg6enW.olfSvih4brJkp1wWvB6Hps_$_ieprod_$__$_
localhost       FALSE   /       FALSE   2826942570      cookie 
/images/ochi-097f.JPG%26%23ffff00%26%23fedcba%26%23ff00FF


-- 
Francis Turner, CIO Juelich Enzyme Products GmbH
***** new contact details *****
[EMAIL PROTECTED] - http://www.biocatalysis.com
+49-611-962-4693(office) +49-173-291-7278(cell)

If you're not part of the solution, you're part of the precipitate.
             -- Henry J. Tillman


Reply via email to