解析器错误消息:无法识别的配置部分 httpCookies
我已将以下内容添加到我的 asp.net mvc3 中的 web.config
文件中,以阻止脚本访问 cookie:
如下:
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
**<httpCookies domain="String" httpOnlyCookies="true" requireSSL="false" />**
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
但是当我运行该应用程序时,它引发了以下错误:- 解析器错误消息:无法识别配置节 httpCookies。
I have added the following to my web.config
file in my asp.net mvc3, to stop script from accessing the cookies:<httpCookies domain="String" httpOnlyCookies="true" requireSSL="false" />,
as follows:
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
**<httpCookies domain="String" httpOnlyCookies="true" requireSSL="false" />**
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
but when I ran the application it raised the following error:-
Parser Error Message: Unrecognized configuration section httpCookies.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
元素是
元素的子节点,因此您必须将其放入其中:The
<httpCookies>
element is a child node of the<system.web>
element so you must put it inside: