We have a GWT app that is deployed on Tomcat. On the server, we have set a timeout of 1 minute
httpSession.setMaxInactiveInterval(1*60)
At the client-side, we set a few cookies with a timeout value of 1 minute as well. After 1 minute, we notice that the client-side cookies are removed; However the JSESSIONID set by the servlet container(jetty/tomcat) is still present in the client.
On Session timeout, our user wants us to throw an alert/message dialog to alert him/her that the session has timed out and the user should log in to the server again. It appears that we need a a client-side callback on the timeout -- is there an API that we can call to set a callback on Session Timeout ?
As of now, if the user hits the server with an expired session, we do tell him that the session has expired; However the Customer wants us to prevent "lost changes" by alerting the user that the session has timed out( without wasting time on editing any of the client-side data and then submitting to finding out that the session has timed out -- lost changes!)
What are other ways of dealing with the situation ?
Thank you,