Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 7cdbca0dc95f2c635187711d7bd9599010f2c575 1 parent 7d5f06b
TJ Holowaychuk tj authored
Showing with 2 additions and 3 deletions.
  1. +1 −0  examples/chat/app.js
  2. +1 −3 lib/express/plugins/session.js
1  examples/chat/app.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)
4 lib/express/plugins/session.js
View
@@ -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

Aaron Heckmann

Was just about to open this one. you win.

Please sign in to comment.
Something went wrong with that request. Please try again.