【发布时间】:2019-07-20 00:28:33
【问题描述】:
我正在使用表单身份验证的 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??
【问题讨论】:
-
是否您的生产服务器使用 SSL? ULR 是否以
https:开头? -
是的,它使用 SSL
-
我有同样的问题,一切都是 https 并且我有一个证书,但我收到了这个错误。我们的 F5 将流量从 http 重定向到 https 并使用端口 80。
标签: c# asp.net requiressl