//Client-side:
var socketConnection = io.connect();
socketConnection.on('connect', function() {
const sessionID = socketConnection.socket.sessionid; //
...
});
//Server-side:
io.sockets.on('connect', function(socket) {
const sessionID = socket.id;
...
});