My web.config
My Global.asaxCode:<sessionState mode="InProc" />
Then I have 3 pages: default.aspx, page1.aspx and page2.aspxCode:void Session_Start(object sender, EventArgs e) { Session.Timeout = 1; string CookieHeaders = HttpContext.Current.Request.Headers["Cookie"]; if ((null != CookieHeaders) && (CookieHeaders.IndexOf("ASP.NET_SessionId") >= 0)) { // It is existing visitor, but ASP.NET session is expired Response.Redirect("expired.aspx"); } }
When I access default.aspx and leave it idle for more than 1 minute I get redirected to expired.aspx as I was supposed to.
But if I click page1.aspx I will not be redirected to expired.aspx again anymore.
I´d like to get redirected no matter what page I´m surfing on and I´d like to control that in just one place if possible, avoiding to have "if(something) redired to xxx.aspx" in every single page.
What should I do to make that happens once my session has expired?


Reply With Quote
Bookmarks