从通过网络请求的设备获取唯一的静态ID [英] Get unique, static id from a device via web request

查看:262
本文介绍了从通过网络请求的设备获取唯一的静态ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我想补充一些自定义统计的一个MVC应用程序。对于一些统计的,这将是很好有一个设备的唯一标识符。

例如,如果我有一个RSS订阅一个唯一的ID,我可以监视的RSS订阅的积极数量。

我想知道是否有人知道在网络请求任何可以作为比IP(这可以明显改变)以外的ID。像设备ID什么的?

谢谢,

奥利弗


解决方案

下面是一些需要考虑的方法。

HTTP标题

有几个HTTP头,你可以看看,可以帮助你找出一个独特的用户或设备 - 有些人会引用到SIM卡,有的请参阅设备。
下面是我从谷歌的Adsense Mobile使用衍生头以帮助跟踪他们的广告列表:


  • X-dcmguid

  • X-向上subno

  • X-jphone的uid

  • X-EM-UID

这些可能是一些非常流行的年代,但将是很受欢迎更多的供应商/设备特定的头文件。你可以开始收集所有的网站收到的报头和算多少你们每个人收到,并开始建立自己的共同头的数据库。

一些其他的方法

缓存

饼干的东西,可以请求代理(浏览器为例)进行设置,并再次代理访问时返回。对于方法的列表,请查看以来的Cookie - 无形中永久性的Cookie - 它的工作原理是利用下列之一方法,其中至少有一个将工作:


   - 标准的HTTP cookies
  - 本地共享对象(闪光饼干)
  - Silverlight的独立存储
  - 在自动生成的,强制缓存的RGB值存储Cookie
    PNG格式使用HTML5 Canvas标签读取像素(饼干)退了出去
  - 存储在网络历史记录的cookies
  - 在HTTP ETag的存储Cookie
  - 存储网络缓存饼干
  - window.name缓存
  - Internet Explorer的用户数据存储
  - HTML5会话存储
  - HTML5本地存储
  - HTML5环球存储
  - 通过HTML5的SQLite数据库存储


组合

它也可以拿出自己的方案,例如采取用户代理头,其他的一些头文件,如接受 X-fowarded换和IP使出他们能够更准确地确定该代理的唯一一个唯一哈希值。

有如下看到许多不同的移动头。我也创下我的页面和存储来自各种设备的移动头为我自己的目的,在这里的http:// wap.defza.com/ua/ua.txt (也ua1.txt,ua2.txt等)

I have an MVC application that I would like to add some custom stat's to. For some of the stat's, it would be nice to have a unique identifier for a device.

For example, if I have a unique id for a RSS subscriber, I can monitor the active number of RSS subscribers.

I was wondering if anyone knew of anything in the web request that could be used as an ID other than the IP (which can obviously change). Something like a device ID or something?

Thanks,

Oliver

解决方案

Here are some approaches to consider.

HTTP Headers

There are a few HTTP Headers you can look at that can help you identify a unique user or device - some would refer to the sim card, some refer to the device. Here is a list that I derived from the headers that Google Adsense Mobile uses to help track their advertising:

  • x-dcmguid
  • x-up-subno
  • x-jphone-uid
  • x-em-uid

These are probably some very popular one's, but there would be more vendor/device specific headers that are popular. You could start gathering all the headers your site receives and count how many of each you receive and start building up your own database of common headers.

Some other approaches

Cookies

Cookies is something that can be set on the requesting agent (browser for example) and returned when the agent visits again. For a list of methods, check out Ever Cookie - the virtually permanent cookie - it works by using one of the following methods of which at least one will work:

 - Standard HTTP Cookies 
 - Local Shared Objects (Flash Cookies)
 - Silverlight Isolated Storage 
 - Storing cookies in RGB values of auto-generated, force-cached 
    PNGs using HTML5 Canvas tag to read pixels (cookies) back out
 - Storing cookies in Web History 
 - Storing cookies in HTTP ETags 
 - Storing cookies in Web cache 
 - window.name caching
 - Internet Explorer userData storage
 - HTML5 Session Storage 
 - HTML5 Local Storage 
 - HTML5 Global Storage 
 - HTML5 Database Storage via SQLite

Combinations

It's also possible to come up with your own scheme, e.g. take the user-agent header, some other headers like accept, x-fowarded-for and the ip make a unique hash value of out them to more accurately determine the uniqueness of the agent.

There are many different mobile headers as seen here. I also hit a page of mine and store mobile headers from various devices for my own purposes here http://wap.defza.com/ua/ua.txt (also ua1.txt, ua2.txt etc)

这篇关于从通过网络请求的设备获取唯一的静态ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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