Logout and go to Login Form

Posted by Community Admin on 03-Aug-2018 10:28

Logout and go to Login Form

All Replies

Posted by Community Admin on 21-Jan-2011 00:00

I have two pages, called Login and Start.

Page Login contains a Login control.  In the Login control, the property DestinationPageUrl 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.

Posted by Community Admin on 21-Jan-2011 00:00

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

Posted by Community Admin on 21-Jan-2011 00:00

Thanks Ivan.

Posted by Community Admin on 27-Jan-2011 00:00

i try adding the property you say, but it doesn't runs....
any suggestion?

Posted by Community Admin on 27-Jan-2011 00:00

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

Posted by Community Admin on 02-Jan-2013 00:00

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?

Posted by Community Admin on 04-Jan-2013 00:00

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

This thread is closed