Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Extracting the cookie value

by MrCromeDome (Deacon)
on Aug 07, 2003 at 21:56 UTC ( #282046=note: print w/replies, xml ) Need Help??

in reply to Extracting the cookie value

"After the user is logged in, I want to be able to take the cookie valye into a scalar so I can split and use the $user and $pass. . . "

Please tell me I'm misunderstanding your intentions. You're not going to store a user name and password in your cookie, are you? If so, let me visit your site with my friend JavaScript ;) You'd be much better served by storing a unique (and very hard to guess) session ID in the user's cookie, then looking up information about that session from something on the server (database, file, etc.). Much more efficient, much more secure.

See Mr. Muskrat's code for how to read the cookie properly. Excellent suggestion, ++ to him :)


Replies are listed 'Best First'.
Re: Re: Extracting the cookie value
by BUU (Prior) on Aug 08, 2003 at 02:22 UTC
    You're not going to store a user name and password in your cookie, are you?

    You realize thats exactly how perlmonks does it? see?
      Yeah :) Doesn't mean it's the best way of doing it though ;) I didn't pay attention to what he was using his app for, but it frankly doesn't strike me as being the best way of handling logins regardless of when/where it is used.

      Of course, TIMTOWTDI! :) That's just the rather biased opinion of this Perl Monk ;)


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2021-04-13 01:31 GMT
Find Nodes?
    Voting Booth?

    No recent polls found