A potentially dangerous Request.Cookies value was detected from the client

a potentially dangerous request form value was detected from the client javascript
avoiding the a potentially dangerous request form value was detected

Everytime when I open a Website Project/Web, Project in Visual Studio 2010 and try to run in Debug/non debug mode (F5/F11) I get this error error: "A potentially dangerous Request.Cookies value was detected from the client " .

I had installed VS 2010 SP1 a months ago, I'm not sure if it's related to this.

It happens to newly created project and existing projects. So I can't run any project.

I set the validaterequest in page and in web.config as most of the google search results sites suggested but I can't pass through this error.

Does someone know what the problem is and how to solve this problem?

SET in PAGE: <%@ Page validateRequest="false" %>

SET in WEB.CONFIG:

<system.web>         
       <pages validateRequest="false" />     
</system.web> </br>

< /configuration>

Server Error in '/WebApp' Application.

A potentially dangerous Request.Cookies value was detected from the client (DNNPersonalization=". After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see http://go.microsoft.com/fwlink/?LinkId=153133.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Cookies value was detected from the client (DNNPersonalization="

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Cookies value was detected from the client (DNNPersonalization="


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

Use

<system.web>
    <httpRuntime requestValidationMode="2.0" />
</system.web>

In your web.config

A Potentially dangerous Request.Cookies value was detected, A Potentially dangerous Request.Cookies value was detected from the client. I am storing xml-string in cookies. when I am retriving cookies  Description:  Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack.

You get this error when ASP.NET blocks pages from sending html tags in GET/POST arguments and cookies to prevent script injection attacks. You can either:

  1. encode arguments/not send any html tags
  2. disable request validation

You can disable request validation for the whole site by adding to Web.config:

<configuration>
    <system.web>
        <httpRuntime requestValidationMode="2.0" />
        <pages validateRequest="false" />
    </system.web>
</configuration>

To disable for a single page, add to Web.config:

<configuration>
    <system.web>
        <httpRuntime requestValidationMode="2.0" />
    </system.web>
</configuration>

and add to the .aspx page:

<%@ Page validateRequest="false" %> 

More Info: http://www.asp.net/learn/whitepapers/request-validation

A potentially dangerous Request.Cookies value was detected from, A potentially dangerous Request.Cookies value was detected from the client .. Created: 10. Feb 2012. Exception occuring when opening page in website. Re: A potentially dangerous Request.Cookies value was detected from the client Aug 31, 2011 06:42 PM | JulesBartow | LINK I wouldn't set ValidateRequest to false in your page directive without having a bunch of cross site scripting and SQL inject attacks.

I had the same issue in MVC, while I was running the site under localhost. Simply delete the cookies.

a potentially dangerous request.cookies value was detected , Cookies value was detected from the client (DNNPersonalization="<profile><item key=""). Error Details: A potentially dangerous Request. A potentially dangerous Request.Form value was detected from the client (txtValue=": &#, "). then i searched on the net, i got one general solution for this that to set the validaterequest to false. But no changes has been made on my application. Please help me for solving this issue. Any response that would be appreciated.

How to prevent the Exception "A potentially dangerous Request , A potentially dangerous Request.Cookies value was detected from the client (​Dynamicweb.SessionVisitor="rDynamics= "). E-mail notifications. A potentially dangerous Request.Cookies value was detected from the client (DNNPersonalization=". After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the configuration section.

A potentially dangerous Request.Cookies value was detected from the client (​IndexLogPreferences=" <?xml version="1.0""). User-  A potentially dangerous Request.Form value was detected from the client. The error exception A potentially dangerous Request.Form value was detected from the client occurs someone tries to submit HTML or JavaScript code to server. Such exception comes since ASP.Net MVC has inbuilt mechanism to prevent XSS (Cross Site Scripting) attacks.

A potentially dangerous Request.Cookies value was detected from the client (​S8ContactName="<a href=`Documentati"). "S8ContactName" IS  A potentially dangerous Request.Path value was detected from the client (&). A potentially dangerous Request.Path value was detected from the client (&).

Comments
  • Hi Arindam, you're a life safer... All the projects work now. But that means I need to change all projects web.config. What's the matter could you please clarify? thanks again for this golden tip...