|
@ -2,14 +2,12 @@ const session = require("express-session") |
|
|
const config = require("../config") |
|
|
const config = require("../config") |
|
|
var RedisStore = require('connect-redis')(session); |
|
|
var RedisStore = require('connect-redis')(session); |
|
|
|
|
|
|
|
|
var sess = { |
|
|
|
|
|
|
|
|
module.exports = session({ |
|
|
secret: config.session.secret, |
|
|
secret: config.session.secret, |
|
|
store: new RedisStore(config.redis), |
|
|
store: new RedisStore(config.redis), |
|
|
cookie: {}, |
|
|
|
|
|
|
|
|
cookie: { |
|
|
|
|
|
secure: config.session.secure |
|
|
|
|
|
}, |
|
|
resave: false, |
|
|
resave: false, |
|
|
saveUninitialized: true, |
|
|
saveUninitialized: true, |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sess.cookie.secure = config.session.secure |
|
|
|
|
|
|
|
|
|
|
|
module.exports = session(sess) |
|
|
|
|
|
|
|
|
}) |