Is it possible to call some JS when the user closes a window?
I searched for JS event handlers and found only onunload, which calls the script whenever the user leaves a page, not necessarily closing the window.
The intended use is to call an AJAX script that unsets a few sessions pertinent to the popup window. There may or may not be a better way of achieving this aim?
I found this DevShed thread in which it is stated that this is possible through JS, but it does not explain exactly how to call the script.
Unfortunately most Google searches for a solution to this bring up window.close, which is effectively the opposite to what I need!