1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Problem with session variable, not reflecting the value

Problem with session variable, not reflecting the value

3 posts, 0 answered
  1. Ankit
    Ankit avatar
    2 posts
    Registered:
    05 Mar 2011
    20 Jul 2011
    Link to this post
    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.
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    25 Jul 2011
    Link to this post
    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();

    Kind regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Ankit
    Ankit avatar
    2 posts
    Registered:
    05 Mar 2011
    25 Jul 2011
    Link to this post
    Hi Victor Velev,

    Thanks a lot for your response, these line of code really solve our Problem with session.

    Thanks and Regards
    Ankit Rastogi
3 posts, 0 answered