After the user successfully logged in, I store login = true in database. But how do I check if the user logged out by close the browser without click the logout button? And somemore, how do I redirect user who has been inactive for 10 minutes to login page?
I am using php and mysql. Any help would be appreciated.
EDIT: Sorry if my question is not clear. I did use session to store whether they are loggin or not. But, now i want to store the info in database, so that i can display their status on other pages. Lets user1 has 3 friends. When display all his friends, he want to know whether his friend is online or offline. This is what I want. Any advise?