Skip to content

Instantly share code, notes, and snippets.

@phongkt-dev
Created June 7, 2019 06:09
Show Gist options
  • Select an option

  • Save phongkt-dev/21173963e77fa0e2e937706984f83cf2 to your computer and use it in GitHub Desktop.

Select an option

Save phongkt-dev/21173963e77fa0e2e937706984f83cf2 to your computer and use it in GitHub Desktop.
var express = require('express')
var parseurl = require('parseurl')
var session = require('express-session')
var app = express()
const mongoose = require('mongoose');
// Basic usage
mongoose.connect(connectionOptions);
app.use(session({
secret: 'keyboard cat',
resave: false,
saveUninitialized: true,
store: new MongoStore({ mongooseConnection: mongoose.connection })
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment