Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Cookie issue on some systems

by ralphch (Sexton)
on Jun 28, 2004 at 13:42 UTC ( [id://370193]=perlquestion: print w/replies, xml ) Need Help??

ralphch has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm setting a cookie for an Admin System in the following way: print "Set-Cookie: northlands=staff&$fr{username}-$zones; PATH=/; domain=.domain.com\n\n";
And then reading it with $ENV{HTTP_COOKIES}.

On most systems it works just fine, but on some Windows XP PCs using IE, the cookie won't be set unless lots of security settings are changed. Is there any fix to this? Or maybe use some other type of authentication form (sessions? -never used these before-)? Something that can be migrated to easily.

Thanks,
Ralph

Edit by castaway, unceremoniously unconsidered (was considered as dupe of itself: 4/1/16)

Replies are listed 'Best First'.
Re: Cookie issue on some systems
by Joost (Canon) on Jun 28, 2004 at 18:47 UTC
    I used to have similar constructs to read and set cookies, but since it turned out to be very error prone, and I'm lazy, I now use the cookie system that's build in in CGI and CGI::Cookie.

    I suggest you give it a try.

    Joost.

    PS: There might still be problems with setting cookies on certain browsers because of privacy setting and the like, but at least you can be reasonably sure it's not your code that's the problem.

Re: Cookie issue on some systems
by ralphch (Sexton) on Jun 28, 2004 at 17:53 UTC

    I finally ended up changing the code to use CGI::Session and passing the session ID along the query string, instead of using cookies. Right now, it's all running as mod_cgi. Were I to migrate it to mod_perl in the future, would CGI::Session have any problems?

    Thanks,
    Ralph

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-26 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found