ASP.NET sets Session.IsNewSession to True even if my session is not expired RRS feed

  • Question

  • User53570601 posted

    I have a big web application and most of my pages put data in session which is later used by itself or its child pages. On closing every page, I have an Ajax method which clears the session of page. Every time I clear session for a particular page, I check if HttpContext.Current.Session.IsNewSession = True, that’s mean my session is expired and give message to close all pages and re-logon (this is normal behavior of my application).

    My session expiry time is 60 minutes BUT sometimes, ASP.NET sets the HttpContext.Current.Session.IsNewSession = True even if the session timeout is not happened (say user is using and suddenly she gets session expiry message on my Ajax call).

    Can someone tell me why ASP.NET sets HttpContext.Current.Session.IsNewSession = True before the actual timeout even my whole application doesn’t set it explicitly?

    Thursday, November 10, 2011 10:52 AM