通過配置出站規(guī)則getcookie添加HttpOnly
在網(wǎng)站根目錄下找到文件“Web.config”,在其中添加如下出站規(guī)則:
-
-
-
<rule name="Add HttpOnly">
-
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
-
-
<add input="{R:0}" pattern="; HttpOnly" negate="true" />
-
-
<action type="Rewrite" value="{R:0}; HttpOnly" />
-
-
-
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
-
-
<add input="{R:0}" pattern="; Secure" negate="true" />
-
-
<action type="Rewrite" value="{R:0}; Secure" />
-
-
-
添加完成后圖示
測試結(jié)果
搞定!
該文章在 2022/9/26 10:04:22 編輯過