Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
If I run from the Unix command line:#!/usr/local/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); use strict; my $query = new CGI; my $cookie = $query->cookie( -name => 'test', -value => 'banana' ); print $query->header(-type => "text/html", -cookie => $cookie ) || die "Cannot set cookie $!"; print "Hello";
However, when running via a webserver, the script dies when it tries setting the cookie. (If I remove the "die" statement, it prints "hello". What have I missed? CheersSet-Cookie: test=banana; path=/ Date: Wed, 22 Sep 2004 03:43:55 GMT Content-Type: text/html; charset=ISO-8859-1 Hello
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't set cookie
by ikegami (Patriarch) on Sep 22, 2004 at 04:33 UTC | |
by Anonymous Monk on Sep 22, 2004 at 05:15 UTC | |
by ikegami (Patriarch) on Sep 22, 2004 at 05:18 UTC | |
|
Re: Can't set cookie
by Errto (Vicar) on Sep 22, 2004 at 03:52 UTC |