实施不要在asp.net mvc中跟踪 [英] Implementing Do not track in asp.net mvc

查看:66
本文介绍了实施不要在asp.net mvc中跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何实现不跟踪来自asp.net mvc3的浏览器同意? 如果用户已设置为不跟踪其浏览器中启用的设置,那么所有主流浏览器(例如IE,Firefox和Chrome)是否都会发送一些Cookie同意请求?

How do I implement do not track browser consent from asp.net mvc3? Do all major browsers like IE, Firefox and Chrome send some cookie consent request if the user has set do not track settings enabled in their browser?

推荐答案

不跟踪"仅表示浏览器随每个请求发送DNT标头,仅此而已.它不提供任何其他客户端功能.启用时,标头的值为1,禁用时发送0或省略标头.

"Do Not Track" just means that the browser sends the DNT header with every request, that's all it is. It does not provide any additional client functionality. The header has a value of 1 when enabled, and either sends 0 or omits the header when disabled.

作为Web应用程序开发人员,除非您参与开发访客跟踪系统,否则无需担心DNT标头,在这种情况下,组织中的高层将告诉您是否应尊重是否标题.

You, as a web application developer, do not need to concern yourself with the DNT header unless you are involved in developing visitor tracking systems, in which case the higher-ups in your organisation will tell you if you should respect the header or not.

在ASP.NET中,您可以像这样检索标头:

In ASP.NET you can retrieve the header like so:

String doNotTrack = Request.Headers["DNT"];
if( doNotTrack == "1" ) {
    // Do not track the user
    // ...whatever that means.
}

这篇关于实施不要在asp.net mvc中跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆