switched express-session for cookie-session
This commit is contained in:
parent
b5267bcc38
commit
426b605acb
2 changed files with 8 additions and 2 deletions
|
@ -30,6 +30,7 @@
|
||||||
"body-parser": "^1.17.1",
|
"body-parser": "^1.17.1",
|
||||||
"config": "^1.26.1",
|
"config": "^1.26.1",
|
||||||
"connect-multiparty": "^2.0.0",
|
"connect-multiparty": "^2.0.0",
|
||||||
|
"cookie-session": "^2.0.0-beta.3",
|
||||||
"express": "^4.15.2",
|
"express": "^4.15.2",
|
||||||
"express-handlebars": "^3.0.0",
|
"express-handlebars": "^3.0.0",
|
||||||
"express-session": "^1.15.5",
|
"express-session": "^1.15.5",
|
||||||
|
|
|
@ -14,7 +14,8 @@ const PORT = 3000; // set port
|
||||||
const app = express(); // create an Express application
|
const app = express(); // create an Express application
|
||||||
const db = require('./models'); // require our models for syncing
|
const db = require('./models'); // require our models for syncing
|
||||||
const passport = require('passport');
|
const passport = require('passport');
|
||||||
const session = require('express-session');
|
// const session = require('express-session');
|
||||||
|
const cookieSession = require('cookie-session');
|
||||||
|
|
||||||
// configure logging
|
// configure logging
|
||||||
const logLevel = config.get('Logging.LogLevel');
|
const logLevel = config.get('Logging.LogLevel');
|
||||||
|
@ -40,7 +41,11 @@ app.use((req, res, next) => { // custom logging middleware to log all incoming
|
||||||
});
|
});
|
||||||
|
|
||||||
// initialize passport
|
// initialize passport
|
||||||
app.use(session({ secret: 'cats', resave: false, saveUninitialized: false }));
|
app.use(cookieSession({
|
||||||
|
name : 'session',
|
||||||
|
keys : ['testcatstest'],
|
||||||
|
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||||
|
}));
|
||||||
app.use(passport.initialize());
|
app.use(passport.initialize());
|
||||||
app.use(passport.session());
|
app.use(passport.session());
|
||||||
passport.serializeUser(serializeSpeechUser); // takes the user id from the db and serializes it
|
passport.serializeUser(serializeSpeechUser); // takes the user id from the db and serializes it
|
||||||
|
|
Loading…
Reference in a new issue