* Create a new `Session` with the given request and `data`. * * @param {IncomingRequest} req * @param {Object} data * @api private
(req, data)
| 21 | */ |
| 22 | |
| 23 | function Session(req, data) { |
| 24 | Object.defineProperty(this, 'req', { value: req }); |
| 25 | Object.defineProperty(this, 'id', { value: req.sessionID }); |
| 26 | |
| 27 | if (typeof data === 'object' && data !== null) { |
| 28 | // merge data into this, ignoring prototype properties |
| 29 | for (var prop in data) { |
| 30 | if (!(prop in this)) { |
| 31 | this[prop] = data[prop] |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Update reset `.cookie.maxAge` to prevent |
nothing calls this directly
no outgoing calls
no test coverage detected