in reply to Problems setting a cookie

Just remove that "standard line", for it is both superfluous and wrong (when you're on a UNIX, \n ist really \012, ASCII 10, LF, which is not CRLF as HTTP wants it). The CGI::header function does what you want, and correctly.

--
http://fruiture.de

Replies are listed 'Best First'.
Re: Re: shield from content statement
by wolverina (Beadle) on Nov 17, 2002 at 11:52 UTC
    I have html text in the script, so if i remove the line, i get a server error. -Lisa

      The HTTP-Header must be the _very first_ thing your script sends to STDOUT:

      #somewhere in the beginning of your program # nothing has been sent to STDOUT yet print $cgi->header( -cookie => $your_cookie, -type => 'text/html' );
      --
      http://fruiture.de
        Yes.. for some strange reason the cookie makes the script act abnormal if i put the cookie before the http header. I was thinking of using a javascript cookie instead.. -Lisa.