Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

socket.id



//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;
  ...
});
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
3+7 =