We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not seem to store sessions to the database and the last commit was a few years ago.
The text was updated successfully, but these errors were encountered:
I'm not able to repro the "not storing sessions to the database" issue, both our tests and the following script seem to store sessions just fine:
var express = require('express'); var session = require('express-session'); var MongoDBStore = require('connect-mongodb-session')(session); var app = express(); var store = new MongoDBStore({ uri: 'mongodb://localhost:27017/connect_mongodb_session_test', collection: 'mySessions' }); // Catch errors store.on('error', function(error) { console.log(error); }); app.use(require('express-session')({ secret: 'This is a secret', cookie: { maxAge: 1000 * 60 * 60 * 24 * 7 // 1 week }, store: store, // Boilerplate options, see: // * https://www.npmjs.com/package/express-session#resave // * https://www.npmjs.com/package/express-session#saveuninitialized resave: true, saveUninitialized: true })); app.get('/', function(req, res) { res.send('Hello ' + JSON.stringify(req.session)); }); server = app.listen(3000);
After visiting localhost:3000, session added:
Sorry, something went wrong.
No branches or pull requests
Does not seem to store sessions to the database and the last commit was a few years ago.
The text was updated successfully, but these errors were encountered: