in reply to javascript.. perl.. cookie

Greetings,
Im unable to reproduce your problem. I would suggest looking into using CGI::Cookie for cookie parsing especially if you are unsure of the source of those cookies. Also Mozilla(netscape) has a really handy cookie manager so you can see if your cookies are being set and how.
Here is how I tested it (and I got something back).
#!/usr/bin/perl -w use CGI; use CGI::Cookie; use strict; use Dumpvalue; my %cookies = fetch CGI::Cookie; my $q = new CGI; if(%cookies){ dump_ref(\%cookies); }else{ my $this_url = $ENV{'SCRIPT_NAME'}; print $q->header(); ################################################# #pasted code from posting ################################################# print qq* <script language=javascript type="text/javascript"> <!-- function SetCookie(username, value, expires, path, domain){ document.cookie = username + "=" + escape(value) + ((expires == null) ? "" : "; expires=" + expires.toGMTString() +) + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" : "; domain=" + domain); } var expiration = new Date(); expiration.setTime(expiration.getTime() + 60000); SetCookie('username', 'Peter', expiration); // --> </script> <br> <a href="$this_url">Check cookies</a> *; exit; } ################################################# #what do we have in there? ################################################# sub dump_ref { my $ref = shift; my $dumper = new Dumpvalue; print $q->header(); print "<pre>"; $dumper->dumpValues($ref); print "</pre>"; exit; }
simple I know but I hope that helps.
I was wondering about your line
var expiration = new Date(); expiration.setTime(expiration.getTime() + 60000);
was expiration suppose to be expires?
-injunjoel