rewrites, setting response cookie "SameSite=none" issue

Mark Munro 1 Reputation point
2021-03-23T13:32:48.243+00:00

We have a rewrite requirement in our application that sets a response cookie to "SameSite=none". This is the code block that we needed to comment out to partially get the application to run.

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

I've been working on this for a day and this is what I've done so far: ![80724-updaterewrite.png][1]![80725-then.png][2] [1]: /api/attachments/80724-updaterewrite.png?platform=QnA [2]: /api/attachments/80725-then.png?platform=QnA we're trying to replicate how we'd do this in IIS / or Apache but thus far we haven't been successful with App Services and Application Gateway in Azure. Any help would be really appreciated.

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
956 questions
{count} votes