In
global.asax
in the
Session_Start
event. You can check for a session cookie in the request there. If the session cookie exists, the session has expired:
public void Session_OnStart()
{
if (HttpContext.Current.Request.Cookies.Contains("ASP.NET_SessionId") != null)
{
HttpContext.Current.Response.Redirect("SessionTimeout.aspx")
}
}