Constant Server Communication problem

I would like to appraise the moment when user will logout from the application including more extreme situation like computer crash.

Previous solution:

I have added Button.ClickListener to MainWindow but there is one problem with it. The application is trying to communicate with server by every single clickment. For users who have slow speed connection it is really serious problem.

There is a way to handle not every single clickment but comunication with server?

The WindowCloseListener is not support such a extreme situation.

Could you give me another efficient solution how to find out about the moment when user is not active any more? I would like to have information with 10 min precision. After such a time session is going to expired.

If you just want to expire sessions after 10 minutes of inactivity, you should set the session timeout of your servlet container (web.xml):

<session-config>
    <session-timeout>10</session-timeout>
</session-config>

(from the
Book
)

Here’s another quickly googled link:

http://www.xyzws.com/Servletfaq/can-i-control-session-timeout/12

Best Regards,
Marc

But ,how to handle the moment when session is no more active. The session will not expire after comuter crash.I like to execute some SQLQueries when user is absent. What I meant previously, that i want to execute some SQLQueries after more extreme situation.