Fabio,
 
You may only call header() once and it must be the first thing sent to the browser since this sends the HTTP headers (and cookies) to the browser. In the your Perl source code you are calling header() *twice* the second call you are using the cookie thus it is printing on the web page instead of in the HTTP headers.
 
Michael
----- Original Message -----
Sent: Sunday, April 21, 2002 4:03 PM
Subject: Cookie not setting correctly.

Hi All,
 
    I've been trying to set a cookie but instead of it to be set  it's been showed to me by browser the information below.I tried to find the answer in the the Web however i didn't find anything yet. can someone help me?
 
 
Fabio Set-Cookie: Fabio=Usuario; path=/Curriculum; expires=Mon, 19-Apr-2004 19:56:46 GMT Date: Sat, 20 Apr 2002 19:56:46 GMT Content-Type: text/html; charset=ISO-8859-1
 
Tks for using 
 
    I'm using apache server, win2k and IE6.I decided to put the code i wrote to find out if someone can help me.
 
my $query = new CGI;
print $query->header();
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(-no_xhtml);
use CGI::Cookie;
 
$to_set = CGI::Cookie->new(-name => "Fabio",
      -value => "Usuario",
      -expires => "+2y" ,
      -path => "/Curriculum");
   
 print
  header(-cookie=>$to_set),
  start_html("Tks"),
  h1("Tks for using"),
  end_html();    
 
 
I hope someone can help me.Tks in advance!
 
Fabio Quintao - Rio de Janeiro - Brazil
[EMAIL PROTECTED]

Reply via email to