in reply to Re: Cookies created via CGI.pm and CGI::Cookie incorrectly made
in thread Cookies created via CGI.pm and CGI::Cookie incorrectly made

Putting the cookie after the header was a means for me to see what the actual Set-cookie: header would look like, since I don't have shell access to this server.

The point you make really has nothing to do with why the cookie itself is being written entirely incorrectly, so incorrectly, that my browser won't even accept the cookie.

I understand how to use the CGI and the CGI::Cookie modules, I just haven't a clue why both of these modules are mucking up so badly

 

-justin simoni
!skazat!

  • Comment on Re: Re: Cookies created via CGI.pm and CGI::Cookie incorrectly made

Replies are listed 'Best First'.
Re: Re: Re: Cookies created via CGI.pm and CGI::Cookie incorrectly made
by perrin (Chancellor) on Mar 18, 2003 at 07:35 UTC
    I think he's right. Try it. CGI::Cookie uses some tricky stuff to make the print $cookie possible and it may get messed up after you call the header method. You can debug the headers by using GET -ed http://yourserver.com/ to dump them out. GET is a script that comes with LWP, which you should install if you don't already have it.
Re: Re: Re: Cookies created via CGI.pm and CGI::Cookie incorrectly made
by dws (Chancellor) on Mar 18, 2003 at 08:51 UTC
    Putting the cookie after the header was a means for me to see what the actual Set-cookie: header would look like, since I don't have shell access to this server.

    In that case, change   print $cookie; to   print $cookie->as_string();

      Hmm, I failed to see that, but it still doesn't make much difference. the as_string() method doesn't seem to be even in the public interface of CGI.pm, I see it in the docs of CGI::Cookie, but it doesn't change anything outputted.

       

      -justin simoni
      !skazat!

        You are calling the as_string() method. Your "print" triggers the overload for stringification in CGI::Cookie.