Socket.io how to get id?

How to get Id (unical key) from server (socket.io)?

i tired with clients[socket.id] = socket;

but i get error

 connections property is deprecated. use getconnections() method

Any Idea?

You can get ID of socket in socket.io by simply:

var id = socket.id;