How can I use DotNetNuke's built-in Sessions a

2019-08-28 06:02发布

问题:

Does anyone have an example of how to use DNN's built-in functionality for a custom Login Module which can store the User Login with a Session and Cookie?

I don't want to re-invent the wheel.

Thanks

回答1:

Check out DotNetNuke.Entities.Users.UserController. It has all kinds of methods for user handling. For login it has

void UserLogin(int portalId, UserInfo user, string portalName, string ip, bool createPersistentCookie);
UserInfo UserLogin(int portalId, string username, string password, string verificationCode, string portalName, string ip, ref UserLoginStatus loginStatus, bool createPersistentCookie);