This is a very common problem. Too bad that there isn't a standard HTML tag
that allows something like this:
<ONCLOSE href=
http://mysite.com/logout.aspx />
I'm not sure if JavaScript can handle this. Downside of JavaScript is that
it can be disabled by the user, or unsupported by browser. I think and
<onclose> html tag should've been part of standard html.
Since it isn't, I think using timeouts is the only way. You can try limiting
the timeout to 5 minutes, and every time there is activity on the webpage,
you reset the timer. This means if the user stares at the same page for 5
minutes, the login session expires.
This could be eased with a JavaScript code that calls a
http://mysite.com/keepalive.aspx, to reset the timer.
Lisa