Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Problem setting cookie using CGI::Cookie

by chromatic (Archbishop)
on Jun 04, 2003 at 23:35 UTC ( [id://263183]=note: print w/replies, xml ) Need Help??


in reply to Problem setting cookie using CGI::Cookie

&url prints a header

You only get to print the header once per invocation. You have to stick the cookie in there before you print it. I'm not having much luck making sense out of your variable names or comparisons, so I can't say for sure that this is your problem, but checking the request method sure looks like it'll print the header too eary to set a cookie.

By the way, calling a sub with the &url syntax is not only ugly, it does things implicitly that you may not want. See perlsub for more. I much prefer url() and recommend that you consider it.

Replies are listed 'Best First'.
Re: Re: Problem setting cookie using CGI::Cookie
by kutsu (Priest) on Jun 04, 2003 at 23:48 UTC

    Oops...I said that wrong, the &url is used to load my css. Also, I prefer url() as well, I just used & because I wasn't originally planning on using cookies (so &url was Location: ...), until I found out the boss doesn't want to use .htaccess.

    Update:Took out CGI::Cookie, forgot why I had it there in the first place, and my path is correct (I just don't want to post it because of security)

    Thanks for pointing that out though, I went ahead and changed that, didn't help my problem though.

    "Pain is weakness leaving the body, I find myself in pain everyday" -me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2025-06-12 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.