Jump to content

Remember Me! checkbox with cookies


MasterACE14

Recommended Posts

Evening people,

 

I have a login page on my website, and thats working fine, I have 3 input boxes, username, password and e-mail. And I have a check box called "Remember Me" which I want to create a cookie, so the next time a person comes to log into my website they don't have to type in their username, password and e-mail again. I have no idea how to do this, But I do know how to create cookies.

 

Regards ACE

 

 

Link to comment
https://forums.phpfreaks.com/topic/70882-remember-me-checkbox-with-cookies/
Share on other sites

you need to set the cookie like you said you know how to. then what you want to be doing is testing on the login page whether that cookie has been set - so call to the cookie:

 

$cookieusername = $_COOKIE['username'];

$cookiepassword = $_COOKIE['password'];

 

then pass these two (cookieusername and cookiepassword) into your login tester and if they work then the person is logged in. Not a highly secure way of doing business mind you...never store a password in a cookie, unless its a home project with nothing big in mind, and md5() your passwords anyway...at the least!

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.