如何获得浏览器的唯一会话ID [英] How to get a unique session ID of a browser

查看:779
本文介绍了如何获得浏览器的唯一会话ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务器变量(如REMOTE_ADDR,Instand_ID等)不能用作浏览网站的PC/Smartohone的保证唯一ID.当ADSL连接经过第三方(在许多国家/地区很普遍)时,尤其如此.第三方没有很多合法IP,因此,数百个PC浏览网站获得相同的IP地址.

由于理论上每台PC/智能手机都将具有唯一的CPU编号或唯一的网卡编号,为什么浏览器也不能传递唯一的ID来标识此PC/设备?在我看来,提供唯一ID的浏览器支持对于网站设计师或与安全有关的问题非常有用.

The server variables like REMOTE_ADDR, Instand_ID etc. can not be taken as guaranty unique ID for the PC/Smartohone that browsing the website. This is specially true when the ADSL connection goes through a 3rd party which is common practice in many countries. The 3rd party do not have a lot legal IP and so, hundreds of PC browsing website get same IP address.

Since every PC/smartphone would in theory have an unique CPU number or unique network card number, why Browser could not also pass over an unique ID to identify this PC/device? It seems to me that browser support to offer an unique ID would be a very useful for website designer or security concerned issues.

Is there such feature / facility available somewhere?

推荐答案

string s = System.Guid.NewGuid().ToString();

使用全局唯一标识符...仅生成唯一..........
string s=System.Guid.NewGuid().ToString();

Use Global Unique Identifier...It Generate Unique only........


这篇关于如何获得浏览器的唯一会话ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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