code: function idGen(channel, info) {
          var cid = channel.registry.generateClientId();
          var cookies;
          var ids;
  
  
          // Return the id only if token was validated.
          // More checks could be done here to ensure that token is unique in ids.
          ids = channel.registry.getIds();
          cookies = info.cookies;
          if (cookies.player) {
  
              if (!ids[cookies.player] || ids[cookies.player].disconnected) {
                  return cookies.player;
              }
              else {
                  console.log("already in ids", cookies.player);
                  return false;
              }
          }
      }
docs: Assigns Player Ids based on cookie token.