Handling users within socket.io is as simple or as complex as you decided, though there are some more 'obvious' approaches for doing this, this documentation is going to outline an approach using map().
map()