As the title implies, the automatically login system is wildly used by many websites. But I could not figure it out by myself. Could you please give me some hint.
EDIT: Yes, I mean the remeber me feature like google.
thanks.
As the title implies, the automatically login system is wildly used by many websites. But I could not figure it out by myself. Could you please give me some hint.
EDIT: Yes, I mean the remeber me feature like google.
thanks.
When a user logs in you simply have php create a cookie stating wich user is logged in at that computer. The cookie will remain for as long as you want it to, so this is equivelant of checking a box with "keep me logged in". If you need them to re-login everytime replace the cookie by a session-variable. A user stays in the session as long as he stays on the website.
So depending on the checkbox's setting php will decide whether to use sessions or cookies.
I hope this is what you wanted to know.
"Remember me" type logins on a site are very simple to implement. There's nothing magical about it. The two major changes are:
on
sets a permanent session cookie instead of a temporary one