Created
January 19, 2014 18:21
-
-
Save biggora/8508814 to your computer and use it in GitHub Desktop.
Add session store in TrinteJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Default session configuration | |
* Inject app and express reference | |
* | |
* Created by init script | |
* App based on TrinteJS MVC framework | |
* TrinteJS homepage http://www.trintejs.com | |
**/ | |
var config = require('./configuration'); | |
var CaminteStore = require('connect-caminte'); | |
var database = require('./database' ).db; | |
module.exports = function (app,express) { | |
var sessionStore = CaminteStore(express); | |
app.configure(function () { | |
app.use(express.session({ | |
cookie: { | |
maxAge: config.session.maxAge | |
}, | |
key: config.session.key, | |
secret: config.session.secret, | |
store: new sessionStore({ | |
driver: database.driver, | |
collection: 'session', | |
db: database, | |
secret: config.session.secret, | |
maxAge: config.session.maxAge, | |
clear_interval: config.session.clear_interval | |
}) | |
})); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment