Since this is related to Session am creating a new thread.
In banks sites we can’t login twice, As soon as we logged in they will insert 1 record in DB and the same user can’t login again, If the user forgot to sign out the session and closed the window directly. How they were identifying that.
I checked few sites, session time out is 10 mins. After logging in I closed the window again I tried to login immediately and it’s worked.. How they were identifying window close.
Joined: Aug 23, 2010
yeah, i agree with David, that there are situation when it will not work.
I even have seen sites in which we have to call the customer care for this issue.
JS is one of the possible ways to handle this.
There may be many other ways:
Like if a user login through a new windows, we can end the session in the previous opened window after making a check in the DB with the operation performed by the user in the mean time if any work was done for the previous window( i believe banks will have all datas for audit so a check can be made at server side in your case).
Some background procces can be used to reset the user after certain time if he is inactive.
There may be more possible ways of implementation(which i may not know) and it will differ for site to site. But still believe there will be flaws.