SetAuthenticationCookie in RC2
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.SaveChanges();
manager.Provider.SuppressSecurityChecks = false;
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