Hi, First of all i am writing a CF application but this issue maybe more within the JS scope, I have ran out of ideas and hoped someone on here could help.
My problem is I need to popup a window when a user close's the browser window, before you shout at me please read on... I am developing a Intranet application which a user logs into. Once the user log's in a bit of simple SQL updates a field in the db to say that user is logged in therefore no one else can log in using the same user\pass. All is fine IF the user's use the "logout" button as this clears all sessions and updates the required field to say they aren't logged in. I have also created a cron'ed task to clear "ghost sessions" once a user has been idle for more than 20 minutes, this re-updates the db to unlock the user's login. All this is fine until the user close the browser window WITHOUT logging off. What I'm planning to do is popUp a window onUnload() which log's the user out, easy you say, well how do I STOP the window popping up when they user the back\forward buttons or press refresh? I am using a JS var on all the internal links so that isn't a issue its just the back\forward & refresh that is causing the problem. There has got to be a way of getting round this...or maybe I'm not thinking laterally enough? I hope someone can help. Thanks Oliver Cookson :)

