in reply to Re: Re: Cookies created via CGI.pm and CGI::Cookie incorrectly made
in thread Cookies created via CGI.pm and CGI::Cookie incorrectly made
(Note: we are using 2.42, the br method is not supported.)#!/usr/bin/perl -w use strict; use CGI qw(:standard); use CGI::Cookie; my $q = new CGI; my $cookie = $q->cookie(-name => "CUSTOMER1", -value => "WILE E. COYOTE", -Path => "/"); my $cookie2 = new CGI::Cookie(-name => "CUSTOMER2", -value => "BEEP BEEP", -Path => "/"); print $q->header; print $cookie; print "<br>\n"; # $q->br; print $cookie2; print "<br>\n"; # $q->br;
When I invoke this via a browser, it displays:Content-Type: text/html CUSTOMER1=WILE%20E.%20COYOTE; path=/<br> CUSTOMER2=BEEP%20BEEP; path=/<br>
This is in keeping with behavior I would expect.CUSTOMER1=WILE%20E.%20COYOTE; path=/ CUSTOMER2=BEEP%20BEEP; path=/
then the browser will set the cookies properly (and you won't be issuing an empty HTML document either, as your example does).print $q->header(-cookie => [$cookie, $cookie2]); print "Hello there!<br>\n";
#!/usr/bin/perl print <<EOF; Set-cookie: CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 09-Nov- +03 23:12:40 GMT Content-type:text/html <html><body> Here is some HTML blather. </body></html> EOF exit(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Cookies created via CGI.pm and CGI::Cookie incorrectly made
by skazat (Chaplain) on Mar 21, 2003 at 02:52 UTC |