<rewrite>
<outboundRules>
<clear />
<rule name="AddSecureCookieFlag" preCondition="" enabled="true">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{HTTPS}" pattern="on" />
</conditions>
<action type="Rewrite" value="{R:0}; secure" />
</rule>
<rule name="AddSameSiteCookieFlag" preCondition="" enabled="true">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{HTTPS}" pattern="on" />
</conditions>
<action type="Rewrite" value="{R:0}; SameSite=None" />
</rule>
</outboundRules>
</rewrite>