Is there a way to generate a unique ref for a user? Maybe based on machine ID, CPU/motherboard, or anything else which comes though which can be accessed server side from a webpage?
I am looking to see if I created a kin开发者_JS百科d of Id based on a the machine without the need for a cookie.
If you find this using ONLY webserver code or javascript client code, then you've found a security hole in a browser that should soon be patched. By design, browsers limit information that is sent to the server or exposed to script.
You can either use a cookie, get the user to run some other code (you can use flash cookies, etc), or look at something like Panopticlick (which is not nearly 100% reliable) or BrowserSpy
You might be able to glean some methods from BrowserSpy.
A webpage will never have access to the computers hardware. You need a program to run locally on the machine (java, c++, c#..) with full trust to gain access to this ressources. Maybe you can also use a signed applet or ocx control, but most users won't accept that.
The information the browser sends to the server like user agent, language, installed plugins and IP address are the only information you have. They aren't guaranteed to be unique, though.
The answer is "not really". Javascript does not directly provide any of the information you require, and I think you need to ask yourself why you need this info.
That said, for IE only, you could construct an ActiveX object that grabbed the necessary information and passed it out to javascript. Wouldn't be compatible with other browsers/OS' though. See the article here to see an example of getting the processor details into javascript.
精彩评论