Bulb Flash:- Setting a Dangerous Cookie on the Browser!!

During a recent assignment we were trying to set an xml string in the browser cookie. The string actually being a security token had a combination of signatures and unicode characters which the browser did not seem to like too much:-)

So after we set the cookie,every time i would browse the solution i was greeted by a A potentially dangerous Request.Form value was detected from the client message and i couldn’t browse any further. Seems its .NETs way of making sure no one is trying to use malicious code to hack his way into your application..

If you are sure you want this cookie then make this change in your web.config and you will be fine!

<pages validateRequest="false" />


<httpRuntime  requestValidationMode="2.0"/>

Hope this bulb flash saves you some time and gray cells!!

Until Next time!


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>