简体   繁体   中英

Clientside socket.io get SessionID

I want to get current ClientSessionID from a user's browser window with javascript

Basically something like this:

var io = io (  );
io.emit ( 'Command', {id: /* Client ID HERE */ }, parameters: [ 'hello', 'world' ] );

It might be better to pass your stuff in one json by parameters like this:

var myJson={
id:1,
parameters:["hello", "word"]
}

io.emit ("command", myJson);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM