Solution:
according to socket.IO documentation
Each Socket in Socket.IO is identified by a random, unguessable, unique identifier Socket#id. For your convenience, each socket automatically joins a room identified by this id.
So you can store these ids in an array on the connection
event, and on exit
you can remove it from the list.