(data)
| 114 | // for when the sid cookie is not yet available. |
| 115 | // This expects that the client emits an event with the sid. |
| 116 | function setSession(data) { |
| 117 | if (!data || !data.sid || typeof data.sid !== 'string') { return; } |
| 118 | var sid = data.sid; |
| 119 | |
| 120 | getSession(sid, function(err, session) { |
| 121 | if (session) { |
| 122 | // unassign socket from previous sessions |
| 123 | _.each(socketIndex, function(val) { |
| 124 | delete val[client.id]; |
| 125 | }); |
| 126 | |
| 127 | indexSocket(sid, client, session); |
| 128 | } |
| 129 | }); |
| 130 | } |
| 131 | |
| 132 | client.on('server:setSession', setSession); |
| 133 | client.on('server:setsession', setSession); // allow lowercase |
nothing calls this directly
no test coverage detected