Click to See Complete Forum and Search --> : How to add Remember password Option
icecream
07-15-2005, 02:26 AM
Hi
My Product is the stable product which has gui page.
i would like to add Remeber Password & ID option in home page.
I dont know much about in creating cookies.
If u have any samples, please update to me.
[Linux oriented]
-Arun
leonpmu
07-15-2005, 02:52 AM
Erm, could you please give a little more detail, we have absolutely no idea exactly what you are asking for.
je_fro
07-15-2005, 03:49 AM
I think he wants to add that option to the login of a web page.
icecream
07-15-2005, 05:43 AM
yes , i want to add that in my login page.
Using java in LINUX.
goon12
07-15-2005, 10:19 PM
One way to do it:
Have a user_sessions table in your database, so when a user logs in; you store the value of the session cookie you set on their browser and their user id. If they don't check "Remember Password" ( or "Remember Me" ), then expire the cookie when the session ends, if they do check that option, then set the expire date on the session cookie to never (maybe a year? - your call) expire.
So next time a user comes to your site with a session cookie already on their browser, check the database and see if there is a valid record in the database, for that user, in the user_sessions. If so - then they don't need to log in.
There are alot of ways to do it, I just thought I would post that. It's probably not the mose efficient way to do it either, because you might want to check on every request to be safe.
-goon12
bwkaz
07-16-2005, 08:51 AM
Well... you have to check on every request, whether you want to be "safe" or not. The HTTP protocol has no state -- each request comes in on a different connection. The only state-type things you have are cookies and form fields. One of these has to hold the session ID, and you have to check that the session ID is valid on every request.
Now, it might be that whatever server-side scripting language you're using already checks this for you. But it has to be checked by something. ;)