Permalink
Browse files

moved to mongo sessions for reduced dependencies

  • Loading branch information...
1 parent dd5805d commit ba0e8396ec037f90844a12289fedc4762b60e5cf @hunterloftis hunterloftis committed Apr 10, 2012
Showing with 14 additions and 10 deletions.
  1. +10 −3 app/lib/middleware.js
  2. +3 −2 config/default.env.json
  3. +1 −5 package.json
View
@@ -1,8 +1,9 @@
var express = require('express'),
connect = require('connect'),
stylus = require('stylus'),
- RedisStore = require('connect-redis')(express),
- connect_timeout = require('connect-timeout');
+ //RedisStore = require('connect-redis')(express),
+ connect_timeout = require('connect-timeout'),
+ MongoStore = require('connect-mongodb');
// Middleware
@@ -22,10 +23,16 @@ module.exports = function(app) {
});
// Sessions
+ var mongoStore = new MongoStore({
+ url: app.config.session.url,
+ maxAge: app.constants.session_length
+ });
+
var session_middleware = express.session({
key: app.config.session_key,
cookie: { secure: true },
- store: new RedisStore(),
+ //store: new RedisStore(),
+ store: mongoStore,
maxAge: app.config.session_length
});
View
@@ -1,8 +1,6 @@
{
"view_engine": "jade",
"view_options": { "layout": false },
- "NODE_ENV": "production",
- "timeout": 10000,
"cookie_secret": "mysecret",
"session": {
"key": "mykey"
@@ -13,5 +11,8 @@
"redis": {
"host": "localhost",
"port": 6379
+ },
+ "session": {
+ "url": "mongodb://localhost:27017/base12_session"
}
}
View
@@ -14,6 +14,7 @@
"connect-timeout": "latest",
"stylus": "latest",
"connect-redis": "latest",
+ "connect-mongodb": "latest",
"express-resource": "latest",
"express-messages": "git://github.com/hunterloftis/express-messages.git#master",
"redis": "latest"
@@ -34,10 +35,5 @@
"title": "base12 app",
"session_length": 1209600000,
"request_timeout": 10000
- },
- "provision": {
- "node": "0.6.12",
- "mongodb": "2.0.3",
- "redis": "2.4.8"
}
}

0 comments on commit ba0e839

Please sign in to comment.