I have been using a session variable in a web app I have been working on and wanted to re-direct the user to log back on if the session expired. Due to the non-existence of an HttpContext object in the global.asax session_end event, I used a client based solution.

<META HTTP-EQUIV=’refresh’ content=’56;URL=http://www.google.com’>

After 56 seconds, a page with this directive in it will navigate to google; the default session timeout in IIS is 20 minutes so replacing the 56 with 1170 would navigate 30 seconds prior to session expiry.

Advertisements