For versions above 1.0, check Karan Kapoor's answer. For older versions, you can access any connected socket using io.sockets.sockets[a_socket_id] , so if you set the status variable for it, io.sockets.sockets[a_socket_id].status will work.
First you need to check if the socket really exists, and it can also be used to check for connected / disconnected statuses.
if(io.sockets.sockets[a_socket_id]!=undefined){ console.log(io.sockets.sockets[a_socket_id]); }else{ console.log("Socket not connected"); }
source share