Hi ,
I am trying to log a user in programmatically and am wondering that the best approach these days is.
I have tries this but its is a little dodgy. for instance var ls read LOGIN_SUCCESS however userInfo.UserId is still -1
var userIP = System.Web.HttpContext.Current.Request.UserHostAddress;
var ls = new Security.Membership.UserLoginStatus();
UserController.UserLogin(PortalSettings.PortalId, submitted.uName, submitted.pWord, "", PortalSettings.PortalAlias.ToString(), userIP, ref ls, true);
var loggedInUser = UserController.GetUserById(PortalSettings.PortalId, UserInfo.UserID);
I also just found this link but the approach seems longer that it should be ( I am no expert so if I am wrond let me know)
http://toby-qingnan.blogspot.ca/2010/06/dnn-programmaticly-login-user.html
Thanks
Mark