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");
}
}
}
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
Post a Comment