MCPcopy Index your code
hub / github.com/deployd/deployd / setSession

Function setSession

lib/session.js:116–130  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getSessionFunction · 0.85
indexSocketFunction · 0.85

Tested by

no test coverage detected