There are many ways to handle it. You should decide what is important to your users and for your environment, and how you define a session expiration.
In one GWT application, I use the Google UserService to get the current user on the server side. I make sure the user is logged in at the start, and I make sure that I handle expired sessions throughout the application when the user makes a new request to the server. It does nothing to detect session expiration on the client side, but the valid session duration is defined in days. Here's a link to a good starting point that uses a timer to detect and process inactivity on the client: http://gwt-ext.com/forum/viewtopic.php?t=1682 The code in the above link uses GWT-Ext widgets, but can be easily adapted to use standard GWT widgets. Keep in mind that there are many different variations of how you define inactivity... Some servers declare your session dead if you have not sent a message in some amount of time -- you could periodically send a "ping" message to insure your session does not go stale. BUT, that may cause you to exceed your request quotas on the Google servers. Then, consider the user experience. If your application is working correctly, your user may not know when messages are going between client/server. So, you may need to track something else to determine when the session is inactive. Lastly, consider how the users see the session expiration. In one GWT application, I did something similar to what is shown in the GWT-Ext link. Some folks using the app did not like the idea that they had been logged out without seeing where in the application they were. So, I changed my app to tell them they had been logged out (with a dialog box), and upon acknowledging the message they were sent to another page. I do not know your particular design constraints, but I think I have given you the highlights of things to consider. Best of luck, Rick -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
