ensim server perl fails to set cookies

Hi,

I have a ensim server with webreseller. I noticed that my server if failing to to set cookies through Perl, however it works under PHP. I tried the Perl scripts which deal with cookies on another server and it works fine. I even test out the server with a simple perl script which sets a cookie, but still fails. Here's an example of the simple set cookie script i tested on netfirms. http://luckymomo4.netfirms.com/cgi-bin/cookie.cgi
Anyone what mite have caused this problem on my server, any apache or perl configurations?

#!/usr/bin/perl -w
# cc-set.cgi - set cookie with CGI::Cookie
use CGI qw(ensim server perl fails to set cookiestandard);
use CGI::Cookie; # this line is new

unless (param()) {
# display form
print
header(),
start_html("Cookie Baker"),
h1("Cookie Baker"),
start_form(),
p("What's your name?", textfield("NAME")),
submit(),
end_form(),
end_html();
} else {
# process form and set cookie
$name = param("NAME");
$to_set = CGI::Cookie->new(-name => "username",
-value => $name,
-expires => "+30s",
-path => "/~gnat/zd",
); # this has changed
print
header(-cookie => $to_set),
start_html("Thanks!"),
h1("Thanks for using the Cookie Baker"),
p("I set your name to ", b($name),
" and I will remember this if you visit ",
a({-href => "cc-get.cgi"}, "here"),
" within the next 30 seconds."),
end_html();
}

 

 

 

 

Top