Navigation Menu

Skip to content

Commit

Permalink
We cannot use(Cookie) within Session.init()
Browse files Browse the repository at this point in the history
This is dueue to Session being above Cookie in the
plugins stack, hence missing when the cookie data
gets populated.

With some re-working this can change, however
it is not very important at the time. We can
just use(Cookie) before Session.
  • Loading branch information
tj committed Feb 5, 2010
1 parent 7d5f06b commit 7cdbca0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/chat/app.js
Expand Up @@ -9,6 +9,7 @@ configure(function(){
use(MethodOverride)
use(ContentLength)
use(CommonLogger)
use(Cookie)
use(Cache, { lifetime: fiveMinutes, reapInterval: oneMinute })
use(Session, { lifetime: fiveMinutes, reapInterval: oneMinute })
set('root', __dirname)
Expand Down
4 changes: 1 addition & 3 deletions lib/express/plugins/session.js
Expand Up @@ -5,8 +5,7 @@
* Module dependencies.
*/

var utils = require('express/utils'),
Cookie = require('express/plugins/cookie').Cookie
var utils = require('express/utils')

// --- Session

Expand Down Expand Up @@ -158,7 +157,6 @@ exports.Session = Plugin.extend({
*/

init: function(options) {
use(Cookie)
process.mixin(this, options)
this.store = new (this.dataStore || exports.Store.Memory)(options)
this.startReaper()
Expand Down

0 comments on commit 7cdbca0

Please sign in to comment.