I've done some extra checking and:
1) My browser definetly receives the cookie.
2) The second script receives no cookies. I used the Dumper thing, I've also tried a foreach (keys %cookies) loop, and I've even tried send a scalar value (instead of the hash).
Is there a way to check if it's a problem with the server config, or if the browser isn't sending the cookie back? (Unlikely, since I've tried it from Linux and Windows using Netscape and IE - both of which behave fine at other cookie-enabled sites.)
P.S. Code now looks like this:
%cookies = fetch CGI::Cookie;
print "<br>Fetched Cookie<br>\n";
print Dumper %cookies; # Prints nothing!!!
print "<br>Just dumped cookie hash.<br>\n";
if(%cookies ne undef)
{
# We get here, so %cookies is defined
print "Keys: ";
foreach (keys %cookies) # Finds no keys!!!
{
print;
print " ";
}
print "<br>---<br>";
if($cookies{'ID'} ne undef)
{
# Tried as a plain hash, hashref, with and without '->value'
my $hashref = $cookies{'ID'};#->value;
$username = $$hashref{'username'};
$password = $$hashref{'password'};
print "Username: $username<br>";
print "Password: $password<br>";
}
else
{
# We keep ending up here!!!!
print "Damn!<br>\n";
}
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.