Permalink
Browse files

We cannot use(Cookie) within Session.init()

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...
1 parent 7d5f06b commit 7cdbca0dc95f2c635187711d7bd9599010f2c575 @tj tj committed Feb 5, 2010
Showing with 2 additions and 3 deletions.
  1. +1 −0 examples/chat/app.js
  2. +1 −3 lib/express/plugins/session.js
View
@@ -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)
@@ -5,8 +5,7 @@
* Module dependencies.
*/
-var utils = require('express/utils'),
- Cookie = require('express/plugins/cookie').Cookie
+var utils = require('express/utils')
// --- Session
@@ -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()

1 comment on commit 7cdbca0

Contributor

Was just about to open this one. you win.

Please sign in to comment.