我正在尝试通过web.config在所有cookie中添加samesite:none。我已经使用重写规则尝试了以下操作,但无济于事:
<outboundRules>
<rule name="Add SameSite None">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="true" />
<action type="Rewrite" value="{R:0}; SameSite=none" />
</outboundRules>
尝试以下操作:
<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" />
<conditions>
</conditions>
</rule>
<preConditions>
<preCondition name="No SameSite">
<add input="{RESPONSE_Set_Cookie}" pattern="." />
<add input="{RESPONSE_Set_Cookie}" pattern="; SameSite=none" negate="true" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>