I have spent two days on this and cannot figure what is the problem with CGI!
I grab a username and password from one perl script and passit to another...It is in this next script that I generate a cookie. However, the cookie is not registered by the browser unless I issue the following lines:
print "Set-Cookie: $cookie1\n"; print "Content-Type: text/html\n\n";
However, I do not want to print the cookie to the screen! Please help, I have included the methods I have created and if you could let me know where Iam wrong please.
Thanks, Siumonsub SetCookie { use CGI qw/:standard/; use CGI::Cookie; $cookie1 = new CGI::Cookie(-name=>'DB', -value=>{ username => $DBuser, password => $DBpasswd, }, -expires => '+1H'); print "Set-Cookie: $cookie1\n"; print "Content-Type: text/html\n\n"; } sub ReadCookie { %cookies = fetch CGI::Cookie; @id = $cookies{'DB'}->value; $exp = $cgi->header( -cookie => DB); print "$id[0] = $id[1]; $id[2] = $id[3]; Expiration = $exp"; }
In reply to CGI::Cookie issues by sdyates
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |