Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by skazat (Chaplain)
on Mar 18, 2003 at 06:48 UTC ( [id://243893]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://243893]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-16 10:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found