我正在使用表单身份验证的 Asp.net 应用程序工作。在我的 web.config 上,我设置了 requiressl property=true。
我一直在进行开发,没有任何问题,但是当我将它部署到我的测试环境时,我得到了下一个错误:
该应用程序被配置为发布安全 cookie。这些 cookie 要求浏览器通过 SSL(https 协议)发出请求。但是,当前请求不是通过 SSL。”
错误是在
在 System.Web.Security.FormsAuthentication.SetAuthCookie(String userName, Boolean createPersistentCookie, String strCookiePath) 在 System.Web.Security.FormsAuthentication.RedirectFromLoginPage
所以我的问题是为什么 FormsAuthentication.SetAuthCookie 通过 http 设置 cookie?以及如何将其设置为通过 https ?