Method to Check Session Time out in ASP.Net

The below method can be used to check the session time out in MSCRM.

Private void CheckSessionTimeOut()
{
if (Context.Session != null)
{
if (Context.Session.IsNewSession)
{
string sCookieHeader = Page.Request.Headers["Cookie"];
if ((null != sCookieHeader) && (sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0))
{
Server.Transfer("SessionTimeOut.aspx");
}
}
}

Comments

Popular posts from this blog

The famous Vanilla story --

Convert fetchXML to SQL Query in MSCRM 4.0

DOGL - Day ONE GO LIVE