I want to prevent the same account being logged in in multiple browser sessions. The how has already been answered. For example: How to restrict user to be logged only one time per session? and PHP /SESSION: Login one per user?
These two approaches prevent the user from logging in again. However Gmail (for example) just logs out the old session. With this technique, to me, it doesn't matter that much if it's done "live" with AJAX calls or on the next page refresh.
I would like to know which one is preferred and what are the cons and pros of both?
So again, the choice:
- Prevent logging in again in new browser session
- Logout the old session (either with AJAX or next request)