I'm building an application where I'd like a unique identifier for every connection for the duration that the app is running and I'm wondering if socket.id works for this. E.g. if user 1 disconnects from the application, user 2 who connects later shouldn't have the same socket.id that user 1 had before even though user 1 is no longer connected. Are socket ids unique for the entire time socket.io is listening to the server?
Assuming that you're using
firstname.lastname@example.org (which is the present version in NPM), the code that generates a new id for each connection/client can be found here.
I think that you can safely assume that each socket id is going to be unique.