in reply to Cookie question ....

It looks like the HTTP header is getting printed out and parsed by the server before you print the header for the cookie (the code you posted). Please post the rest of the code and we might be able to show you where.

Also, are you using CGI or mod_perl?

-caedes

Replies are listed 'Best First'.
Re: Re: Cookie question ....
by Anonymous Monk on Feb 27, 2003 at 06:04 UTC
    Caedes,

    Thanks for your response.

    This is all the code in the beginning of my script-
    #!/usr/bin/perl my $yySetCookies1 = cookie(-name => "test", -value => "test", -path => "/", -expires => ""); print header(-status=>"200 OK", -cookie=> $yySetCookies1); use CGI qw(:standard); # Must be used to get the param() func +tion #use CGI; use CGI::Carp (fatalsToBrowser); #use CGI::Cookie; use strict; use OLE; use Net::SMTP; # Yes, this will work on windows. use MIME::Base64;


    I'm using CGI.

    ANy ideas?

    Thanks, SP
      Nothing there seems to be the cause of your problem although you would do well to clean up your code just a bit. You have a bareword "fatalsToBrowser" on the 6th line. I suggest something like:

      #!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard); my $yySetCookies1 = cookie( -name => "test", -value => "test", -path => "/", -expires => "" ); print header( -status=>"200 OK", -cookie=> $yySetCookies1 );

      -caedes

        Caedes,
        Thanks for your reply. Yeah I tried all that and for some reason it still didn't work. In the end, I figure it and got it working with this (messy, but I think I can make a function out of it now):
        print "HTTP/1.0 200 OK\nCache-Control: no-cache, must-revalidate\nPrag +ma: no-cache\nSet-Cookie: test=test; path=/; expires=Wed, 29 Mar 2005 + 13:49:23 -0500\nContent-Encoding: \nContent-Type: text/html; charset +=\n\n";

        Thanks for your help. SP