I have a site on which you login with a user name and password. Every time the authorized user enters a page, the user database table is updated to tell that this specific user is online. When the user press the logout button, the value shall be set to offline. This I have managed to do.
But what happens if the user closes the browser without pressing the logout button? Is it possible to, for example, set a property in the database cell to change to default value after, like, 10 minutes from last update?
Are there any better ways to do this?