开发者

How would I go about uniquely identifying a computer in node.js?

Simple question, I'm new to using node.js and was curious as to how 开发者_JAVA百科I should uniquely identify a computer?


As with most operations you have no way to identify uniquely a computer. All data is sent stateless and wihout any information of the computer.

But you can change your (x)html application to store unique cookies so the client side part can authenticate to the server with the cookie, perfectly identifying two open tabs of one user.


If you're working with web sockets you can assign each client an id using a random uuid, here's one that'll work on both client and server:

http://www.broofa.com/Tools/Math.uuid.js

and speed benchmarks for each flavor:

http://jsperf.com/uuid-from-broofa-com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜