(socketId, sessionId, callback)
| 34 | /* Attaches the socketId to the session of the user. |
| 35 | */ |
| 36 | saveSession(socketId, sessionId, callback) { |
| 37 | try { |
| 38 | config.redisClient.set(`cb-socket-${socketId}`, sessionId, (err, reply) => { |
| 39 | config.redisClient.expire(`cb-socket-${socketId}`, 30 * 24 * 60 * 60); |
| 40 | if (callback) callback(err, reply); |
| 41 | }); |
| 42 | } catch (err) { |
| 43 | winston.log('error', { error: String(err), stack: new Error().stack }); |
| 44 | } |
| 45 | }, |
| 46 | |
| 47 | deleteSession(socketId, callback) { |
| 48 | try { |