dark0s
03-01-2010, 01:48 PM
I want to set cookie in prova.html page.
prova.html page is:
<html>
<head>
<title>Prova</title>
<head>
<body>
<form action="prova.cgi" method="POST">
<fieldset>
<legend><h2>Set your cookie...</h2></legend>
<input type="text" name="name" /><br/>
<input type="text" name="value" /><br/>
<input type="text" name="expires" /><br/>
<input type="submit" name="submit" /><br/>
<fieldset>
</form>
<body>
</html>
prova.cgi script is:
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $cgi = CGI->new();
print $cgi->header(-type => 'text/html');
print $cgi->start_html('Risposta a prova');
my $cookie = $cgi->cookie(-name => 'sessionID', -value => 'user@networkstore', -expires => '+1h');
my $mycookie = $cgi->cookie('sessionID');
print "<h2>Your cookie is $mycookie</h2>";
but cookie is not set.
Where is the problem?
savio
prova.html page is:
<html>
<head>
<title>Prova</title>
<head>
<body>
<form action="prova.cgi" method="POST">
<fieldset>
<legend><h2>Set your cookie...</h2></legend>
<input type="text" name="name" /><br/>
<input type="text" name="value" /><br/>
<input type="text" name="expires" /><br/>
<input type="submit" name="submit" /><br/>
<fieldset>
</form>
<body>
</html>
prova.cgi script is:
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $cgi = CGI->new();
print $cgi->header(-type => 'text/html');
print $cgi->start_html('Risposta a prova');
my $cookie = $cgi->cookie(-name => 'sessionID', -value => 'user@networkstore', -expires => '+1h');
my $mycookie = $cgi->cookie('sessionID');
print "<h2>Your cookie is $mycookie</h2>";
but cookie is not set.
Where is the problem?
savio