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

Forums / Developing with Sitefinity / problem with logout

problem with logout

2 posts, 0 answered
  1. Priya Ramesh
    Priya Ramesh avatar
    26 posts
    Registered:
    23 Jul 2009
    30 Dec 2009
    Link to this post
    Hi ,
      I have a secure application in my website.I am using a button in my menu to logout. But it is not logging the user out. After I logout it still shows the status as login and the username.The code for onclick for button is

    FormsAuthentication

     

    .SignOut();

     

    Roles

     

    .DeleteCookie();

     

    If I use the loginview control in the page it works and shows the status as logout. But the problem is the pages I previously visited shows up(probably from cache I think). the cache for the page is turned off.
    Can you tell me what code does the logout button in loginview has so I can use the same code in my menu button. Also how do I turn off the page caching.

    Thanks,
    Priya

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Jan 2010
    Link to this post
    Hello Priya Ramesh,

    The ASP.NET control LoginView uses the same method as you use FormsAuthentication.SignOut(); The problem about which you are talking about generally occurs when you use caching. You could try using
    FormsAuthentication.RedirectToLoginPage(); right after FormsAuthentication.SignOut(); This will redirect the user to the login page and he/she should not be able to access the previous url if re type the url in the browser bar.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered