asp.net - 将 [requireSSL ="true"] 放入我的 web.config 返回垃圾页面

标签 asp.net ssl web-config viewstate

我正在尝试将我们的 asp.net 网站配置为使用 SSL,这是我在 web.config 中所做的配置部分的片段

第 1 部分

<httpCookies httpOnlyCookies="true" requireSSL="true"/> <machineKey validationKey="58523DC75CBD3351486A415DB267ADDF4B9432500AB34DF4766D6827CA5A3E4B6F07BE8B6659BB27B90AAC917F317F710494EB16754E4CBD8D12CC22A35D1D2A" decryptionKey="13B9D06984B5AB5358197DD4E0EEAFE5910F24DD360E6EA79A4007F3F9053B21" validation="SHA1" decryption="AES" />

第 2 部分

<authentication mode="Forms" > <forms loginUrl="Login.aspx" protection="All" timeout="40" path="/" requireSSL="true" slidingExpiration="true" defaultUrl="Login.aspx" cookieless="UseCookies" enableCrossAppRedirects="false" > <credentials passwordFormat="SHA1"></credentials> </forms> </authentication>

我使用 IIS EXPRESS 来托管我的网站,现在每次我尝试登录我们的网站时,我都会收到“垃圾”数据,如下所示 om Chrome

enter image description here

和 IE,它提示“下载”

enter image description here

我做错了什么?

谢谢

最佳答案

尝试使用 requireSSL cookie 时需要 https://。在连接到本地系统进行测试时,您是否需要或使用 HTTPS?

关于asp.net - 将 [requireSSL ="true"] 放入我的 web.config 返回垃圾页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18204467/

相关文章:

asp.net - cType : string to date throwing InvalidCastException (ASP) (VB. NET)

asp.net - 我的 ASP.Net 代码可以从 sendgrid 获得电子邮件已发送的确认吗?

c# - 带有 vNext 的 SignalR

node.js - 使用 Express.js 的多个 SSL 证书和 HTTP/2

ruby-on-rails - 如何为使用 SSL 的站点访问者更改 Rails View 代码?

自添加 https 端点后,azure 计算模拟器未启动

visual-studio - Web.config转换:未声明转换属性

c# - Fluent Validation 重载 (Less)GreaterThanOrEqualTo 方法不会呈现相同的结果

asp.net-core - ASP.NET Core Web.Config 发布

iis - 重定向任何尚未在 IIS7 上使用 301 重定向的内容