Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Answer: Cookie based authentication: Is it secure?

( #30267=categorized answer: print w/ replies, xml ) Need Help??

Q&A > CGI programming > Cookie based authentication: Is it secure? contributed by sinan

There is something you can do to insure security. Everytime a user logs on, generate a random number, put it on the user's machine as a cookie.
print "Set-Cookie: temp-id=$random_no;; expires= +".($now+3600);
At the same time, write the same $random_no to a DB on your server, as well as the user's username. So, you can now identify the user using a temporary id.

Hope this helps,


Comment on Answer: Cookie based authentication: Is it secure?
Select or Download Code
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2015-12-01 07:39 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (795 votes), past polls