WM closing event ?

M

Mel

OnBeforeUnload is invoked on a refresh as well as closing the window.

i would like to know when the browser is destroyed from the window manager
or application itself

is this possible ?

i do have a logout button, but users frequently click on WM's "x" to close
the application.

How can i know this ? my application depends on it and people pay for the
time spent on this site by the seconds !!!


thanks for your help
 
J

Joakim Braun

Mel said:
OnBeforeUnload is invoked on a refresh as well as closing the window.

i would like to know when the browser is destroyed from the window manager
or application itself

is this possible ?

i do have a logout button, but users frequently click on WM's "x" to close
the application.

How can i know this ? my application depends on it and people pay for the
time spent on this site by the seconds !!!

There are many ways of closing a browser window:
* Clicking a UI gadget (which will vary with different operating systems)
* Entering a keystroke combination (which will vary with different operating
systems)
* Navigating elsewhere
* Crashing the system
* Disconnecting the computer/modem/network
* Dropping a brick on the computer

If you're on Windows, you might want to look into global hooks and DLLs,
which would let you intercept window messages. Probably won't do you any
good if the system crashes, though. And of course, the users would need to
install the DLL.

In any case, you almost certainly can't reliably do what you want
client-side. It might be a good idea to rethink your problem. How about a
"keep connection alive" scheme: use session IDs, update a timestamp on the
server on every transaction and log out the user after x minutes of session
inactivity.

Joakim Braun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top