OK, so I've filed down my problem. I see where all my confusion has been
coming.
Of course I'm still left with one major problem.
First, here's the situation:
When I use the following code I can write cookies everywhere but in Safari:
----------------------------------------------
my $cookie = "$COOKIENAME=$cookieContent; " .
"domain=www.wpi.edu; " .
"expires=+1h";
print "Set-Cookie: $cookie\n";
----------------------------------------------
After that code I can retrieve the cookie by the following method:
----------------------------------------------
my %cookies = fetch CGI::Cookie;
my $userInfo = $cookies{"WPI_REGI2500"}->value;
----------------------------------------------
Interesting fact, I cannot use this same code to read any other random cookie I
see in my browser (testing with Firefox).
OK, Now, my fixed code to be able to write cookies in any browser is as follows:
----------------------------------------------
my $cookie = $q->cookie( -name => $COOKIENAME,
-value => $cookieContent,
-domain => "www.wpi.edu",
-expires => "+1h",
-path => "/cgi-bin/Regi",
-secure => 1 );
print "Set-Cookie: $cookie\n";
----------------------------------------------
However, once I write the cookie this way, my cookie retrieval function no
longer works. I have verified that the cookie IS there. And it looks exactly
the same as with the other code. But I simply can't read the cookie.
I have tried reading the cookie in several different ways, including reading
from $ENV{"HTTP_COOKIE"}, and doing both "fetch CGI::Cookie" and "parse
CGI::Cookie".
I MUST be reading in these cookies incorrectly in some way.
Can anyone help me, or point me in any helpful direction (other than the pub)?
Thanks.
--Alex
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm