views:

110

answers:

2

Simple question, I'm new to using node.js and was curious as to how I should uniquely identify a computer?

+2  A: 

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.

Tobias P.
A: 

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

thejefflarson