会话Cookie中缺少安全属性

时间:2014-07-15 17:54:16

标签: c# asp.net session web-config

您好我正在asp.net网站上工作。我正在使用会话来保持用户登录。该网站工作正常,直到我不得不添加

<system.web> <httpCookies httpOnlyCookies="true" requireSSL="true" lockItem="true" /> </system.web>

web.config中的

由于审核员报告了漏洞&#34;在会话Cookie中缺少安全属性&#34;。在web.config中添加上述代码后,该站点只是没有检索正在设置的会话。

我收到错误:

Session state can only be used when enableSessionState is set to true, either 
in a configuration file or in the Page directive. Please also make sure that 
System.Web.SessionStateModule or a custom session state module is included in the 
<configuration>\<system.web>\<httpModules> section in the application configuration.

我尝试将enableSessionState添加到web.config

中的我的页面标记中

<pages enableViewStateMac="true" viewStateEncryptionMode="Always" enableEventValidation="true" enableSessionState="true">

任何帮助都会得到满足。提前谢谢。

0 个答案:

没有答案
相关问题