.NET 4.6.1 给cookie添加属性

<rewrite>
    <outboundRules>
        <rule name="Add SameSite" preCondition="No SameSite">
            <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="false" />
            <action type="Rewrite" value="{R:0}; SameSite=None;Secure=True" />
            <conditions>
            </conditions>
        </rule>
        <preConditions>
            <preCondition name="No SameSite">
                <add input="{RESPONSE_Set_Cookie}" pattern="." />
                <add input="{RESPONSE_Set_Cookie}" pattern="; SameSite=None;Secure=True" negate="true" />
            </preCondition>
        </preConditions>
    </outboundRules>
</rewrite>
posted @ 2020-04-03 09:52  天藐水瓶  阅读(259)  评论(0编辑  收藏  举报