kcbanner/connect-mongo — Issue #29: Infinite loop.
Author: murvinlai
Created: 2012-02-28 11:38:25+00:00
State: open

After I did an upgrade on node and npm (connect-mongo @ 0.1.7),
when I do the
express.createServer(
express.cookieParser(),
express.bodyParser(),
express.session({ secret: cfg.session_secret,
cookie: { domain: 'mydomain.com' },
store:new MongoStore({
db: cfg.db_session_name,
host: cfg.db_ip,
port: cfg.db_port
}
)
})
)

Then, once i hit any url / route, I will run into infinite loop:

TypeError: Not a string or buffer
at Object.createHmac (crypto.js:129:21)
at Object.sign (/node_modules/connect-mongo/node_modules/connect/lib/utils.js:135:6)
at Object.serialize (/node_modules/connect-mongo/node_modules/connect/lib/middleware/session/cookie.js:115:17)
at ServerResponse.writeHead (/node_modules/express/node_modules/connect/lib/middleware/session.js:265:46)
at ServerResponse._implicitHeader (http.js:808:8)
at ServerResponse.end (http.js:645:10)
at next (/node_modules/express/node_modules/connect/lib/http.js:167:13)
at pass (/node_modules/express/lib/router/index.js:219:24)
at nextRoute (/node_modules/express/lib/router/index.js:209:7)
at callbacks (/node_modules/express/lib/router/index.js:274:11)

The script was fine an hour ago, but then it just blow up if I use the MOngoStore for express session. is there something wrong I did?