hmmm
details, not even I've realized...

On the other hand....:
Mak, I don't know how much control you have over the pages, or the chat engine, but there must be a way to eliminate the problem from your side... Instead of having the users on counted when clicking on the button, there should be an Onpageclose or OnWindowClose method or something similar to those, maybe those should also contain the logout code, it may solve the problem.