More in this section
Forums / General Discussions / SetAuthenticationCookie in RC2

SetAuthenticationCookie in RC2

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Matt
    Matt avatar
    56 posts
    20 Nov 2009
    23 Dec 2010
    Link to this post
    Where is SetAuthenticationCookie in RC2?  Seems that it is now internal to SecurityManager, so this line fails to compile.  Is there a new way to login programmatically?

    var now = DateTime.UtcNow;
    var ip = SystemManager.CurrentHttpContext.Request.UserHostAddress;
    var manager = UserManager.GetManager();
    var user = manager.GetUser(username);
    user.IsLoggedIn = true;
    user.LastLoginIp = ip;
    user.LastLoginDate = now;
    user.LastActivityDate = now;
    SecurityManager.SetAuthenticationCookie(SystemManager.CurrentHttpContext.Response, "Default", user, false);
    manager.Provider.SuppressSecurityChecks = true;
    manager.Provider.SuppressSecurityChecks = false;


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    27 Dec 2010
    Link to this post
    Hello Matt,

    The method was set to internal, so you cannot use it anymore. You can use our Login control, try using AuthenticateUser or follow this post to authenticate the user by using a web request.

    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
2 posts, 0 answered