I am trying to set a cookie in the middle of my web page. Here is a testcase showing a problem that I believe is happening to me in my program.
This code WORKS:
#!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
print header(
-type => 'text/plain',
-cookie => cookie( -name=>'ident', -value=>'cookie#1')
);
print "Cookie SET";
And this will NOT work:
#!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
print "Trying to set a cookie\n";
print header(
-type => 'text/plain',
-cookie => cookie( -name=>'ident', -value=>'cookie#1')
);
print "Cookie SET";
I need a way to make this work. Maybe spawn off some sort of separate process to do it?
I suspect many people are having a similar problem.
M