title: Socket.io disconnect and redis
body: <p>I'm trying to make my socket.io app scale by switching from a regular data structure that holds all my data, to using redis along with cluster. However, I'm encountering some problems because at some point in the current implementation, I store the socket object along with other properties in this data structure <code>data[socket.id].socket = socket</code> because in my application sometimes I need to do <code>data[someId].socket.disconnect()</code> to manually disconnect the socket.</p>
  
  <p>I understand I cannot store objects directly into redis, so I tried using <code>JSON.stringify(socket)</code> with no success, since <code>socket</code> is circular. Is there another way to disconnect a socket using only the <code>id</code>? That way I can store the <code>id</code> like this <code>data[socket.id].id = socket.id</code> and maybe call it like <code>data[someId].id.disconnect()</code> or something. So basically I'm looking for a way to disconnect a socket without having access to the actual socket object (I do have access to the <code>io</code> object).</p>
  
  <p>Thank you all for your help.</p>