Topic awaiting preservation: How to Script "Remember my password on web pages" (Page 1 of 1) |
|
---|---|
Neurotic (0) Inmate Newly admitted From: |
posted 08-03-2004 19:31
Hi, I would like to be adviced on any information helping or linking me to how i can script the "Remember my password" function ussually found on pages with login forms on web pages or portals. I would like information on using javascript or JSP or PHP to write this script. this is actually my fist time ussing a forum. please pardon me of any error in my mode of presenting my proplem. thanks |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 08-03-2004 21:40
You will probabally want to look at using cookies to store the fact that the user has logged in. A good way to make sure this works properly is to send the user a random hash everytime they login and to then store the current hash in your "users" table in your database. When the user comes back to the site and has a cookie set that says that they are logged in you would also ask for their random hash, if it validates then they should pretty much be the correct person. You don't want to store some stupid value like "loggedin=yes" because that is easy to break, this is why the hash needs to be stored as well. It is harder to forge a random hash. This doesn't mean things will be totally secure. |
Bipolar (III) Inmate From: Australia |
posted 08-05-2004 03:01
I did this lastnight, works a treat! I was previously only storing a username and the logged status in the cookies (dont worry it was only for learning how to do it) but i added the random hash. |
Obsessive-Compulsive (I) Inmate From: |
posted 08-09-2004 17:26
Thanks Guys. But I an quite new to Scripting. i can Add a Cokiie perfectly to a machine, but the problem is the random hash you guys are talking about i dont know how to add a random hash. or does the ramdom hash means that i should generate ramdom caracters and store? I will probably appreciate a sample code on how to do that. please forgive me of all incompetence. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 08-09-2004 19:43
Yeah the random characters and store. What is a simple way to make the hash is to have a little random generator that creates a string and then run the md5() php function on the string to get a good value. |