Problem with session variable, not reflecting the value
We have certain User Controls in our Project, we are using sessions to pass values from one page to another. There is one Logout control which Clears all the session used in the Project like: Session.Clear();Session.Abandon() but after Login again to the Project even by using different LoginId, Sometimes Session values does not reflect it use the previous values.
Hi Ankit,
Can you try and use the following code at the end of the Page_Load method:
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoServerCaching();
HttpContext.Current.Response.Cache.SetNoStore();
Hi Victor Velev,
Thanks a lot for your response, these line of code really solve our Problem with session.
Thanks and Regards
Ankit Rastogi