How to detect session expire programmatically

devlin016

New Member
i search google and found many answers for detecting session expiry programmatically. this is code which i saw everyone use it\[code\]global.asax---------------protected void Session_Start(object src, EventArgs e){if (Context.Session != null && Context.Session.IsNewSession){ string sCookieHeader = Request.Headers["Cookie"]; if (null != sCookieHeader && sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0) Response.Redirect("/Session/Timeout");}}\[/code\]i have few question on the above code1) when session expire then how Context.Session will not be null?2) what is the meaning of this line \[code\]Request.Headers["Cookie"];\[/code\]looking for good discussion. thanks
 
Back
Top