title: IIS Rewrite Rule is not setting HTTP_COOKIE
body: <p>I'm working with a client who has a mobile site setup through a third party. Currently, we check through IIS whether a user agent matches any of your standard mobile agents in which case we redirect the user to the mobile version m.whatever.com.</p>
  
  <p>One of the rules we have requires us to set the cookie to a value of 0 when the user wants to see the mobile site again.    </p>
  
  <pre><code>&lt;rules&gt;
      &lt;rule name="if httpcookie is , set it to 0" stopProcessing="true"&gt;
          &lt;match url="^(.*)$" /&gt;
          &lt;conditions&gt;
              &lt;add input="{HTTP_COOKIE}" pattern="mobileoptout=1" /&gt;
          &lt;/conditions&gt;
          &lt;serverVariables&gt;
              &lt;set name="HTTP_COOKIE" value="mobileoptout=0" /&gt;
          &lt;/serverVariables&gt;
          &lt;action type="None" /&gt;
      &lt;/rule&gt;
  &lt;/rules&gt;
  </code></pre>
  
  <p>As per the above, we're matching on the URL and the cookie value. I have tested these independently and they work as expected. However, at the end of this rule, the value for the cookie MobileOptOut is still 1 and not 0.</p>
  
  <p>I've searched and tried all the examples available on numerous sites but have been completely unable to understand why the value of the cookie is not being changed.</p>
  
  <p>The domain for the cookie is [whatever.com] which is the same as www.whatever.com and based on previous tests it can read from the cookie to validate a condition.</p>
  
  <p>Any ideas?</p>
  
  <p>Including an additional attempt which does not work either:</p>
  
  <pre><code>&lt;rules&gt;
     &lt;rule name="set cookie"&gt;
       &lt;match url="(.*)" /&gt;
       &lt;serverVariables&gt;
         &lt;set name="HTTP_COOKIE" value="optout=1" /&gt;
         &lt;set name="{HTTP_COOKIE}" value="optout=2" /&gt;
       &lt;/serverVariables&gt;
       &lt;action type="None" /&gt;
     &lt;/rule&gt;
  &lt;/rules&gt;
  </code></pre>