Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Server Error in '/' Application.

A potentially dangerous Request.Cookies value was detected from the client (UserInfo="... AM&Image=1 file(s) Upl...").

Description: ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Cookies value was detected from the client (UserInfo="... AM&Image=1 file(s) Upl...").

Source Error:


Line 10: protected void Page_Load(object sender, EventArgs e)
Line 11: {
Line 12: HttpCookie UserInfo = Request.Cookies["UserInfo"];
Line 13: if (UserInfo != null)
Line 14: {

Source File: d:\socialtrade.biz\faq.aspx.cs Line: 12

Stack Trace:


[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Cookies value was detected from the client (UserInfo="... AM&Image=1 file(s) Upl...").]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +9800344
System.Web.HttpRequest.ValidateCookieCollection(HttpCookieCollection cc) +193
System.Web.HttpRequest.get_Cookies() +60
Default2.Page_Load(Object sender, EventArgs e) in d:\socialtrade.biz\faq.aspx.cs:12
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +95
System.Web.UI.Control.LoadRecursive() +59
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6211
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
System.Web.UI.Page.ProcessRequest() +72
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +22
System.Web.UI.Page.ProcessRequest(HttpContext context) +58
ASP.faq_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\67f7b97b\af308eae\App_Web_j25epqks.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +188
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

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

What I have tried:

I searched for this problem but did not get answers how to fix it
Posted
Updated 20-Jun-18 21:19pm
v2

1 solution

It's saying it doesn't trust what you put in the cookie. So, what did you put in the cookie?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900