In an extranet or intranet website you may want to limit the user’s access to a unique machine at at time.
One way to do that is to have a table with the logged users and check the new user against that table and block his access if there is already one instance of that user logged in.
But, what if the user shutdown the browser, or the computer, without logging out of the system ? In that case, he will never be able to loggin again, unless he calls support to clear his record or waits until the session time out.
I found a way to clear the user records in case of window or browser closing, but your content should be inside an iFrame, to keep the main window open and the user logged in. When the user changes pages or close the browser, the event “onBeforeUnload” will call a javascript function that calls a CF template to kill the user session. In that template that kills the session, you may write your code to update the user table.
Download the sample code here.
