First, the reason that I was setting two cookies (actually, the same cookie twice) was that after things didn't work, I was hoping that maybe if I just set the cookie twice I could having to run the whole script twice. I meant to change it back to just a single cookie before I posted the code, but obviously, I forgot. =)
Secondly, the setting code and the fetching code were indeed run in seperate scripts, which were run several seconds apart...i.e. I ran the setting code, took a moment to look at some output, then typed the URL for the fetching script and ran it. So the problem isn't a timing issue. Good call though, to those who suggested that might be it
After working on the code a little more, I found a solution: the setting code works fine the first time IF I don't use CGI::Cookie. Instead I just do:Instead of:print"Set-Cookie: botLogin=$username:$trueName:$Hash\n"; print "Content-Type: text/html\n\n";
Try as I might, I could never get it to work on the first run using CGI::Cookie. Any thoughts on why?my $cookie = $cgi->cookie( -name=>'botLogin', -value=>"$username:$trueName:$Hash"); print $cgi->header(-cookie=>[$cookie,$cookie]), $cgi->start_html(-title=>'Login');
In reply to Re: Re: Cookies Not Getting Set First Time
by Anonymous Monk
in thread Cookies Not Getting Set First Time
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |