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

Re: Extracting the cookie value

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 :)

Cheers!
MrCromeDome

Replies are listed 'Best First'.
Re: Re: Extracting the cookie value
by BUU (Prior) on Aug 07, 2003 at 22: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 ;)

      Cheers!
      MrCromeDome

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://282046]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.