yeah, I tried stage.addEventListener(Event.DEACTIVATE, onDeactivate);but its only triggered when closing the debug window and not on refreshing or closing the browser. I could store the UserID in a SharedObject and logout the prev user when logging in, but this method may be insecure no?