MCPcopy
hub / github.com/deployd/deployd / getSession

Function getSession

lib/session.js:82–91  ·  view source on GitHub ↗
(sid, fn)

Source from the content-addressed store, hash-verified

80 , sid = cookies.get('sid');
81
82 var getSession = function(sid, fn) {
83 // check if we already know about the session
84 var session = sessionIndex[sid];
85 if (session) { return fn(null, session); }
86 // get the session from the store otherwise
87 self.createSession(sid, function(err, session) {
88 if (session.data.id === sid) return fn(null, session);
89 return fn();
90 });
91 };
92
93 var indexSocket = function(sid, client, session) {
94 // index sockets against their session id

Callers 2

SessionStoreFunction · 0.85
setSessionFunction · 0.85

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected