title: socket.io isn't disconnecting on refresh?
body: <p>I am brand new to socket.io and trying to create a sort of mmo using it. However I've been running into a few issues. The current one is if someone refreshes it doesn't look like it is disconnecting the previous socket? In my console it shows the user as having connected twice and will create another listening for the same user.</p>
  
  <p>This is what my console looks like after 3 refreshes:</p>
  
  <pre><code>User has joined : a
  in getMap fora
  user has disconnected
  User has joined : a
  User has joined : a
  in getMap fora
  in getMap fora
  in getMap fora
  in getMap fora
  user has disconnected
  user has disconnected
  User has joined : a
  User has joined : a
  User has joined : a
  </code></pre>
  
  <p>client side:</p>
  
  <pre><code>  var socket = io();
  setUsername();
  
  function setUsername() {
  socket.emit('add user', username);
  }
  
  socket.on('startMap', function (data) {
  socket.emit('getMap');
  });
  </code></pre>
  
  <p>server side:</p>
  
  <pre><code>io.on('connection', function (socket) {
      var addedUser = false;
  
      socket.on('add user', function (username) {
              if (addedUser) return;
  // we store the username in the socket session for this client
      socket.username = username;
          addedUser = true;
      console.log("User has joined : " + socket.username)
      socket.emit('startMap',{username:socket.username});
  
  });//end add user
  
  socket.on('getMap', function(){
      console.log("in getMap for" + socket.username);
  });
    socket.on('disconnect', function(){
    console.log("user has disconnected");
    });
  });
  </code></pre>
  
  <p>After 11 refreshes for same user:</p>
  
  <pre><code>(node:8808) Warning: Possible EventEmitter memory leak detected. 11       disconnect listeners added. Use emitter.setMaxListeners() to increase limit
  (node:8808) Warning: Possible EventEmitter memory leak detected. 11 add user listeners added. Use emitter.setMaxListeners() to increase limit
  (node:8808) Warning: Possible EventEmitter memory leak detected. 11 getMap listeners added. Use emitter.setMaxListeners() to increase limit
  (node:8808) Warning: Possible EventEmitter memory leak detected. 11 updateMap listeners added. Use emitter.setMaxListeners() to increase limit
  </code></pre>