<p>I'm looking to implement httpOnly in my legacy ASP classic sites.
Anyone knows how to do it?</p>

[{'answer_id': 55318, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 1, 'selected': False, 'text': '<p>You need to append ";HttpOnly" to the Response cookies collection.</p>\n'}, {'answer_id': 55389, 'author': 'Aaron Wagner', 'author_id': 3909, 'author_profile': 'https://Stackoverflow.com/users/3909', 'pm_score': 5, 'selected': True, 'text': '<pre><code>Response.AddHeader "Set-Cookie", "mycookie=yo; HttpOnly"\n</code></pre>\n\n<p>Other options like <code>expires</code>, <code>path</code> and <code>secure</code> can be also added in this way.  I don\'t know of any magical way to change your whole cookies collection, but I could be wrong about that.</p>\n'}, {'answer_id': 57423, 'author': 'tqbf', 'author_id': 5674, 'author_profile': 'https://Stackoverflow.com/users/5674', 'pm_score': -1, 'selected': False, 'text': '<p>HttpOnly does very little to improve the security of web applications. For one thing, it only works in IE (Firefox "supports" it, but still discloses cookies to Javascript in some situations). For another thing, it only prevents a "drive-by" attack against your application; it does nothing to keep a cross-site scripting attack from resetting passwords, changing email addresses, or placing orders.</p>\n\n<p>Should you use it? Sure. It\'s not going to hurt you. But there are 10 things you should be sure you\'re doing before you start messing with HttpOnly. </p>\n'}, {'answer_id': 14818679, 'author': 'Brian Clark', 'author_id': 1496402, 'author_profile': 'https://Stackoverflow.com/users/1496402', 'pm_score': 4, 'selected': False, 'text': '<p>If you run your Classic ASP web pages on IIS 7/7.5, then you can use the IIS URL Rewrite module to write a rule to make your cookies HTTPOnly.</p>\n\n<p>Paste the following into the  section of your web.config:</p>\n\n<pre><code>&lt;rewrite&gt;\n    &lt;outboundRules&gt;\n        &lt;rule name="Add HttpOnly" preCondition="No HttpOnly"&gt;\n            &lt;match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="false" /&gt;\n            &lt;action type="Rewrite" value="{R:0}; HttpOnly" /&gt;\n            &lt;conditions&gt;\n            &lt;/conditions&gt;\n        &lt;/rule&gt;\n        &lt;preConditions&gt;\n            &lt;preCondition name="No HttpOnly"&gt;\n                &lt;add input="{RESPONSE_Set_Cookie}" pattern="." /&gt;\n                &lt;add input="{RESPONSE_Set_Cookie}" pattern="; HttpOnly" negate="true" /&gt;\n            &lt;/preCondition&gt;\n        &lt;/preConditions&gt;\n    &lt;/outboundRules&gt;\n&lt;/rewrite&gt;\n</code></pre>\n\n<p>See here for the details: <a href="http://forums.iis.net/t/1168473.aspx/1/10">http://forums.iis.net/t/1168473.aspx/1/10</a> </p>\n\n<p>For background, HTTPOnly cookies are required for PCI compliance reasons. The PCI standards folks (for credit card security) make you have HTTPOnly on your sessionID cookies at the very least in order to help prevent XSS attacks. </p>\n\n<p>Also, at the current time (2-11-2013), all major browser support the HTTPOnly restriction on cookies. This includes current versions of IE, Firefox, Chrome and Safari. </p>\n\n<p>See here for more info on how this works and support by various browser versions:\n<a href="https://www.owasp.org/index.php/HTTPOnly">https://www.owasp.org/index.php/HTTPOnly</a> </p>\n'}, {'answer_id': 31680643, 'author': 'Hernaldo Gonzalez', 'author_id': 1536197, 'author_profile': 'https://Stackoverflow.com/users/1536197', 'pm_score': 0, 'selected': False, 'text': '<pre><code>Response.AddHeader "Set-Cookie", ""&amp;CStr(Request.ServerVariables("HTTP_COOKIE"))&amp;";path=/;HttpOnly"&amp;""\n</code></pre>\n'}, {'answer_id': 62751004, 'author': 'Yvan Zhu', 'author_id': 13054805, 'author_profile': 'https://Stackoverflow.com/users/13054805', 'pm_score': -1, 'selected': False, 'text': '<p>If you are using IIS7 or IIS7.5 and install the URL Rewriting add-in then you can do this. You can create a rewriting rule that adds &quot;HttpOnly&quot; to any out going &quot;Set-Cookie&quot; headers. Paste the following into the &lt;system.webServer&gt; section of your web.config. I then used Fiddler to prove the output.</p>\n<p>Regards, Jeremy</p>\n<pre><code>    &lt;rewrite&gt;\n        &lt;outboundRules&gt;\n            &lt;rule name=&quot;Add HttpOnly&quot; preCondition=&quot;No HttpOnly&quot;&gt;\n                &lt;match serverVariable=&quot;RESPONSE_Set_Cookie&quot; pattern=&quot;.*&quot; negate=&quot;false&quot; /&gt;\n                &lt;action type=&quot;Rewrite&quot; value=&quot;{R:0}; HttpOnly&quot; /&gt;\n                &lt;conditions&gt;\n                &lt;/conditions&gt;\n            &lt;/rule&gt;\n            &lt;preConditions&gt;\n                &lt;preCondition name=&quot;No HttpOnly&quot;&gt;\n                    &lt;add input=&quot;{RESPONSE_Set_Cookie}&quot; pattern=&quot;.&quot; /&gt;\n                    &lt;add input=&quot;{RESPONSE_Set_Cookie}&quot; pattern=&quot;; HttpOnly&quot; negate=&quot;true&quot; /&gt;\n                &lt;/preCondition&gt;\n            &lt;/preConditions&gt;\n        &lt;/outboundRules&gt;\n    &lt;/rewrite&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/55296', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2385/']