Sunday 15 April 2012

How to check session is expired or not.....

protected void Page_Load()  {
   
if (Context.Session != null)
    
{
     
if (Session.IsNewSession)
     
{
         
string cookieHeader = Request.Headers["Cookie"];

         
if ((null != cookieHeader) && (cookieHeader.IndexOf("ASP.NET_SessionId") >= 0))

         
{
           
Response.Redirect("sessionTimeout.htm");
         
}
     
}
   
}  }

No comments:

Post a Comment