Dec 4, 2009

Session Timeout Notification

Sometimes you may need to get notification if session of an application get expired. For the basics of session management you can find my post here.

In all of the above cases, the session supposed to be timeout. It will handle by the runtime, which we can set in the web.config <sessionState timeout="1" />. Default timeout is 20 mins. Which means after 20 min session will become abandon and if you are not correctly handle it will leads to system crash. What general recommendation is, always check null of the session item that you’re going to refer. But in most user oriented application, we should notify the user that ,"Hello your current session has expired, what do you want to do?"
How to achieve this?