(sid, fn)
| 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 |
no test coverage detected