More in this section

Forums / Developing with Sitefinity / User Control Sessions not clearing

User Control Sessions not clearing

4 posts, 0 answered
  1. Kris
    Kris avatar
    4 posts
    Registered:
    01 Oct 2007
    08 Sep 2008
    Link to this post
    Hi currently we are using User Controls to write custom modules for Sitefinity, however in our User Controls there are nested user controls, and when someone uses logout from sitefinity, it does not destroy the session variables that are in the user controls.

    so when they log out and back in again they are seeing data from the previous logged in user. Is there a way to access the log out event of sitefinity i did not see any events exposed in the loginview control in the sitefinity folder for logout. I also tried putting session.abandon in the login1_loggedIn event on the main login page but it still does not destroy the sessions in the user controls.

    Thanks!
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    10 Sep 2008
    Link to this post
    Hello Kris,

    It is not quite clear if the described behavior relates to Sitefinity administration or to the public site. It will be very helpful if you explain in details the steps for reproducing the issue. Also, please send us a simple example (a user control nesting another one) demonstrating the problem to debug it locally.

    You could also try to turn off the cache for the corresponding page and check if the problem still persists.

    Thanks for your cooperation in advance.

    Kind regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Kris
    Kris avatar
    4 posts
    Registered:
    01 Oct 2007
    10 Sep 2008
    Link to this post
    Thank you for the reply. it seems it was not a session issue so much as a viewstate issue. I was using a public static variable which was not being updated even when a user signed out and then back in as a new user. I now grab the new user always instead of trying to keep it in tthe public static variable, and now it works. Thanks for the response!

    -Kris
  4. Adam @Habanero
    Adam @Habanero avatar
    45 posts
    Registered:
    22 Jun 2012
    11 Sep 2008
    Link to this post
    Hey Kris

    Best not to put any data that should be different based on user in a static variable.  Static variables are shared accross all instances of the application, meaning, if you update it for user 1, all other users will now have that same data... could lead to a lot of problems.

    Good luck!
Register for webinar
4 posts, 0 answered