Mike wrote on 10 Dec 2003 at Wed, 10 Dec 2003 16:56:26 GMT:
Create a frame structure and put the unLoad listener on the
window that contains the frames (the top window). That way the
frame containing your app can change URLs willy nilly, but the
unLoad event with your log off routine won't happen until the
top window is unloaded.
What if my browser crashes? What if I disconnect before logging off?
What if my browser doesn't execute onunload events[1]?
Important actions should be carried out as soon as the user does
something that makes those actions necessary. For example, if you are
recording preferences that are in-line, rather than on a separate
page, and the user changes an option, that preference should be
recorded immediately.
The logging off process should be able to occur in two ways: when the
user clicks a 'Log Out' link or button, or after a certain period of
inactivity. Both should do the same things, but only the former
should require user interaction or presence.
Mike
The only thing you can guarantee is that user's don't follow
instructions.
[1] When I was trying to record preferences with onunload (before I
took the advice above), I found that Opera didn't do anything, while
IE did. I tried putting window.open() calls, alert boxes, page
changes, and cookie creation statements into the event, one at a
time, but none of them worked. I assume then, that Opera doesn't
support onunload.
--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")