a question about cookies and MD5
Posted: Thu Aug 23, 2007 11:22 am
Hi all,
I've been creating a user management system wich allows users to register, log in, log out and manage their profiles.
Login script works like this: Gets username and password from username and password textboxes, MD5 encrypts the password, and compares the username and password to that of the database. If everyting is OK, then logs in, otherwise doesn't login.
I added gmail-like "remember me" option to the script. If the user checks to remember the username and password, then the script will set cookies with username and MD5 encrypted password. The next time when the page is loaded, the script checks if username and password cookies had been set. If yes, those values will be shown on username and password textboxes as google does. When I get values from cookies, I will have a username, and a MD5 encrypted password, right? So, with these values, if I submit the form, my login script encrypts the password again, which is already enrypted.
There comes my question. How do I do so that MD5 encrypted password that is stored in $_COOKIES variable, can be shown as a normal password in the password textbox.
Or any other solutions to the problem???
Thank you for your time.
I've been creating a user management system wich allows users to register, log in, log out and manage their profiles.
Login script works like this: Gets username and password from username and password textboxes, MD5 encrypts the password, and compares the username and password to that of the database. If everyting is OK, then logs in, otherwise doesn't login.
I added gmail-like "remember me" option to the script. If the user checks to remember the username and password, then the script will set cookies with username and MD5 encrypted password. The next time when the page is loaded, the script checks if username and password cookies had been set. If yes, those values will be shown on username and password textboxes as google does. When I get values from cookies, I will have a username, and a MD5 encrypted password, right? So, with these values, if I submit the form, my login script encrypts the password again, which is already enrypted.
There comes my question. How do I do so that MD5 encrypted password that is stored in $_COOKIES variable, can be shown as a normal password in the password textbox.
Or any other solutions to the problem???
Thank you for your time.