Skip to content
Myr

next -> callback

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent a3854a2 · Browse files · 1 file+6 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−7 removed

  • other:+6 added−7 removed

1 file+6 added−7 removed

modified:lib/express/plugins/session.js+6 added-7 removed
203 unmodified lines
204 /**205 * Create session id when not found; delegate to store.206 */207 208 request: function(event, next) {208 request: function(event, callback) {209 var sid = event.request.cookie('sid')210 exports.Session.store.fetch(sid, function(err, session) {211 if (err) return next(err)211 if (err) return callback(err)212 if (session.id != sid) 213 event.request.cookie('sid', session.id, exports.Session.cookie)214 214 event.request.session = session215 event.request.session.touch()217 next()216 callback()217 })218 return true219 },220 221 /**222 * Delegate to store, allowing it to save sessions changes.223 */224 226 response: function(event, next) {227 exports.Session.store.commit(event.request.session, next) 228 return true;225 response: function(event, callback) {226 exports.Session.store.commit(event.request.session, callback) 227 return true228 }229 }230})