在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
案例如下: 1:首先在登录的控制器中定义一个全局变量 public const string LonginName = "sessName"; 2:在登陆的方法中 public ActionResult Login(string userNameOrEmailAddress = "", string returnUrl = "", string successMessage = "") ViewBag.ReturnUrl = returnUrl == "/" ? "" : returnUrl; var model = new LoginFormViewModel(); HttpCookie remCookie = HttpContext.Request.Cookies[LonginName]; model.TenancyName = _tenancyNameFinder.GetCurrentTenancyNameOrNull(); 3:在登陆成功后记录Cookie /// <summary> HttpCookie remCookie = HttpContext.Request.Cookies[LonginName];
|
请发表评论