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

Forums / General Discussions / Logout and go to Login Form

Logout and go to Login Form

7 posts, 1 answered
  1. Matt
    Matt avatar
    48 posts
    Registered:
    25 Oct 2010
    21 Jan 2011
    Link to this post
    I have two pages, called Login and Start.

    Page Login contains a Login control.  In the Login control, the property is set to "/Test/Start".

    This works great - the user logs in and is taken to the Start page.

    I've put a Login Status control on the Start page.

    What I would like, is for the user to log out and then be taken back to the Login page.

    What property do I change for that and what do I put into the property?

    Thanks.

    Matt.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Jan 2011
    Link to this post
    Hi Matt,

    You have to use LogoutAction

    The LogoutAction is a property that comes from the base class of LoginStatus control Here are the modes that the property accepts.

    Redirect

    Redirects the user to the URL contained in the LogoutPageUrl property. If LogoutPageUrl is empty, the user is redirected to the login page defined in the application configuration settings.

    RedirectToLoginPage

    Redirects the user to the login page defined in the application configuration settings.

    Refresh

    Refreshes the current page.



    There were issues with LoginStatus control that I fixed earlier today. We are going to have an internal build later today, so you have to upgrade your project.

    If you find any other issues with the control, please write back to us.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Matt
    Matt avatar
    48 posts
    Registered:
    25 Oct 2010
    21 Jan 2011
    Link to this post
    Thanks Ivan.
  4. Ilaria
    Ilaria avatar
    25 posts
    Registered:
    20 Jan 2011
    27 Jan 2011
    Link to this post
    i try adding the property you say, but it doesn't runs....
    any suggestion?
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Jan 2011
    Link to this post
    Hi,

    If you use the latest internal build from the last Friday there should not be a problem. The issue was fixed there.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Eric
    Eric avatar
    4 posts
    Registered:
    18 Oct 2012
    02 Jan 2013 in reply to Ivan Dimitrov
    Link to this post
    Hello,

    We are having a problem with the Logout widget. It does not logout the user. When user is logged on and then they logout, their ID persists; so that when a user with a new set of credentials logs in, somehow, Sitefinity still thinks that the old user is still logged in. We added a LogoutAction URL Redirect, which is just an aspx page where we try to force the logout, using the lines of code below:

    Telerik.Sitefinity.Security.SecurityManager.Logout();
    Telerik.Sitefinity.Security.SecurityManager.DeleteAuthCookies();

    This does not work.

    When I Query the Telerik.Sitefinity.Security.SecurityManager.GetCurrentUserName, it is set to anonymous, but when a new user logs in this has the value of the user that was previously logged in.

    Can you please point us in the correct direction?
  7. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    04 Jan 2013
    Link to this post
    Hello Eric,

     What version of Sitefinity are you using? Please try the following in the meantime:

    // Log out the specified user
    User alreadyLoggedInUser = userManager.GetUser("userName");
    SecurityManager.Logout("Default", alreadyLoggedInUser.Id);
    alreadyLoggedInUser.IsLoggedIn = false;
    userManager.SaveChanges();


    Regards,
    Patrick Dunn
    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
7 posts, 1 answered