Google Adwords 跟踪 cookie 触发 ASP.NET 请求验证异常
抱歉我的英语不好。
我有一个奇怪的问题。 当用户点击 adword 链接时,Google 会像这样写入跟踪 cookie 1813234232.1302674912.30.51.utmgclid=CcgezrsXjagCFcs-zAod_h2oCQ|utmccn=(未设置)|utmcmd=(未设置)|utmctr= CAA:89 AB0=40@B%20>:
关键字部分(utmctr)存在错误的括号,导致请求验证异常从客户端检测到潜在危险的 Request.Cookies 值(__utmz="...0=40@B%20> at System.Web.HttpRequest.ValidateCookieCollection(HttpCookieCollection cc)
有什么方法吗在不关闭请求验证的情况下解决此问题?
已编辑 我可能找到了明显的解决方案:编写自己的请求验证模块 http://jefferytay.wordpress.com/2010/04/15/creating-your-own-custom-request-validation/
Sorry for my English.
I have a strange problem.
When user click adword link, Google write tracking cookie like that1813234232.1302674912.30.51.utmgclid=CcgezrsXjagCFcs-zAod_h2oCQ|utmccn=(not set)|utmcmd=(not set)|utmctr= CAA:89 AB0=40@B%20>:
In keyword section(utmctr) there is bad braskets, that cause request validation exceptionA potentially dangerous Request.Cookies value was detected from the client (__utmz="...0=40@B%20> at System.Web.HttpRequest.ValidateCookieCollection(HttpCookieCollection cc)
Is there any way to solve this problem without turning off request validation?
Edited
I'm probably found obvious solution: write own request validation module http://jefferytay.wordpress.com/2010/04/15/creating-your-own-custom-request-validation/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,asp.net 验证并检查数据是否存在潜在攻击。
您可以通过
在影响所有页面的 web.config 上的页面 ether 上设置
validateRequest="false"
ether 来禁用此自动验证。之后您唯一需要自行检查的是是否有人在您的输入中输入了任何脚本数据。然后,您的输入需要检查何时在页面上呈现它们以及何时将它们输入到数据库中。
By default asp.net validate and check the data for potential attacts.
You can disable this automatic validation by set
validateRequest="false"
ether on pageether on web.config that affect all pages.
The only think that you need to check by your self after that, is if someone enters any script data to your inputs. Your inputs then need to check out when you render them on the page, and when you enter them on the database.