IIS开启httpCookie HttpOnly为true
1.点击对应的站点,在右侧选择"配置编辑器
2.依次点击打开system.web——httpCookies
3.然后修改值为true
4.修改之后会在web.config中找到对应的代码.当然也可以直接在web.config文件中的段添加代码.
<rewrite>
<outboundRules>
<rule name="Add HttpOnly">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
<conditions>
<add input="{R:0}" pattern="; HttpOnly" negate="true" />
</conditions>
<action type="Rewrite" value="{R:0}; HttpOnly" />
</rule>
<rule name="Add Secure">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
<conditions>
<add input="{R:0}" pattern="; Secure" negate="true" />
</conditions>
<action type="Rewrite" value="{R:0}; Secure" />
</rule>
</outboundRules>
</rewrite>
|