We have a classic asp web app and are trying to use URL Rewrite to set the http_only flag on cookies. Our app also needs to chunk transfer encode larger native files (pdf's for example) and to get this to work we've followed the advice to set rewriteBeforeCache=true in the outbound node.
However this is causing IIS to crash on some (but not all) servers we install our app on. The machines are win2k8 R2 x64. The rewrite xml is this:
<rewrite>
<outboundRules rewriteBeforeCache="false">
<!-- Outbound rules are not applied to chunked transfer encoded responses if rewriteBeforeCache is enabled. -->
<rule name="Add HttpOnly" preCondition="No HttpOnly" enabled="false">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="false" />
<action type="Rewrite" value="{R:0}; HttpOnly" />
<conditions>
</conditions>
</rule>
<preConditions>
<preCondition name="No HttpOnly">
<add input="{RESPONSE_Set_Cookie}" pattern="." />
<add input="{RESPONSE_Set_Cookie}" pattern="; HttpOnly" negate="true" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
If we set rewriteBeforeCache to true, we don't see the IIS crash at all.
Is there something we're missing??