posted 22 years ago
Forget about figuring out when a user has logged off. In a web context, there's not enough visual feedback to let him/her know. They can pop over to eBay and come back again and still be logged on. Then there's the problem of the "Blue screen" type of logoff, which (obviously!) isn't going to give you feedback! And of course, some hacker would find a way to exploit it anyway (NEVER trust control information sent from a client!).
Your server may not be advanced enough to support the feature you want - end-of-session detection is a recent addition provided because everyone else ran into the same sort of problem.
If you can, upgrade, if not, I think you're solving the problem the right way.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.