I have seen many examples of IIS URL Rewrite:
<!-- reference: https://im5tu.io/article/2017/06/ensuring-samesite-cookies-with-url-rewrite/ -->
<rewrite>
<outboundRules>
<rule name="Ensure samesite Cookies" preCondition="Missing samesite cookie">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="false" />
<action type="Rewrite" value="{R:0}; SameSite=strict" />
</rule>
<preConditions>
<preCondition name="Missing samesite cookie">
<!-- Dont remove the first line here, it does do stuff! -->
<add input="{RESPONSE_Set_Cookie}" pattern="." />
<add input="{RESPONSE_Set_Cookie}" pattern="; SameSite=strict" negate="true" />
</preCondition>
</preconditions>
</outboundRules>
</rewrite>
Does anyone know why the line <add input="{RESPONSE_Set_Cookie}" pattern="." /> is necessary?
I tried searching on Google but did not find an answer.