jemen 2022-11-04 17:09 采纳率: 0%
浏览 72

iis cookie Secure 设置

IIS 设置 cookie Secure 无效
win10 home
尝试过的解决方法

web.config 无效

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

设置 HttpOnly 有效

<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>           
        </outboundRules>
    </rewrite>

如下设置 浏览器 cookie中没内容

<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>

看网上 ,HttpOnly 有效但是Secure 无效 请教处理方法
https://www.coder.work/article/6687330

我想要达到的结果

img

  • 写回答

1条回答 默认 最新

  • kevinwang32 2022-11-10 14:35
    关注

    请问楼主解决了吗

    评论

报告相同问题?

问题事件

  • 创建了问题 11月4日

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向