Redirect at Session Timeout in Global.asax in mvc4
I am trying to detect when a session ends and then redirect user to the home page once this is done in my global asax file. I am using below code which I found here global.asax: protected void Session_Start() { if (Context.Session != null) { if (Context.Session.IsNewSession) { string sCookieHeader = Request.Headers["Cookie"]; if ((null != sCookieHeader) && (sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0)) { //intercept current route HttpContextBase currentContext = new HttpContextWrapper(HttpContext.Current); RouteData routeData = RouteTable.Routes.GetRouteData(currentContext); //Substitute