Author: rmdw | Posted on: 11/5/2008 6:32:38 PM | Views : 298

On several previous occasions I've posted questions about how best to handle a Session timeout.  If your apps are like mine then the sudden loss of crucial user data is devastating.  I've actually built a sophisticated mechanism to save & restore key session data to/from a DB but still, handling the event when it occurs is critical to a robust app.  To contribute back to the community, I thought I'd share a few thoughts on my best practices to date.
First off, when a Session timeout occurs, the user will not immediately know.  This is because the event is occurring over on the server and is completely separate from the client itself.  The only reasonable way I've found to monitor for a session timeout is to setup an asynchronous call to the server based on a Javascript timer.  It's complicated to setup but doable.

On a simpler level, I've found this to be a good pattern for every Page_Load event handler:
Go to the complete details ...