views:

44

answers:

1

if I am logged in on my application but if i choose closing browser without clicking on logout how will be I logged out from server automatically?

A: 

Unless you have the user explicity log out, your server cannot know the user has closed their browser.

You can simply let sessions timeout naturally, for example, after ten minutes of inactivity.

Alternatively, you can add some js to the page to make regular pings back to the server to keep a session alive while the browser window is open.

Paul Dixon
suppose I have column like lastloggedout in user table which gives me the last loggedout date-time, how will i update it? is there method which will automaticvalyy update my user table after session timeout ?
Vipul
Depends on the platform, but generally speaking, most session handling systems have some form of garbage collection for stale sessions. At that point, you can perform any necessary actions resulting from session expiration.
Paul Dixon