Tag: dotnetnuke module

以其他用户身份登录时丢失会话/ cookie

我正在构建dnn模块,允许登录用户以其他用户身份登录。 但我这里有一些有线问题。 这是我注销当前用户和以其他用户身份登录的方式: UserInfo userInfo = UserController.GetUserById(portalId, userId); if (userInfo != null) { DataCache.ClearUserCache(this.PortalSettings.PortalId, Context.User.Identity.Name); if (Session[“super_userId”] == null) { Session[“super_userId”] = this.UserId; Session[“super_username”] = this.UserInfo.Username; } HttpCookie impersonatorCookie = new HttpCookie(“cookieName”); impersonatorCookie.Expires = DateTime.Now.AddHours(1); Response.Cookies.Add(impersonatorCookie); Response.Cookies[“cookieName”][“super_userId”] = this.UserId.ToString(); Response.Cookies[“cookieName”][“super_username”] = this.UserInfo.Username; PortalSecurity objPortalSecurity = new PortalSecurity(); objPortalSecurity.SignOut(); UserController.UserLogin(portalId, userInfo, this.PortalSettings.PortalName, Request.UserHostAddress, false); Response.Redirect(Request.RawUrl, true); […]

如何在DotnetNuke 7中暂时存储数据?

我是DotnetNuke的新手。 随意建议我正确的术语。 我正在研究DotnetNuke 7.我使用C#。 我有一个包含30个字符串字段的表,它最多可以有50个记录。 目前我正在使用数据库进行管理。 我认为数据并不多,我应该将它存储在本地存储(如果有的话)中,这比从数据库中获取数据要快。 如果在DotnetNuke中有任何本地存储(临时)和生命,有人可以建议我吗? 另外请告诉我关于切换本地存储而不是数据库的想法。