...
|
...
|
@@ -104,22 +104,22 @@ app.use(cookieSession({ |
|
|
}));
|
|
|
|
|
|
app.use((req, res, next) => {
|
|
|
if (req.session) {
|
|
|
let sessionKeys = Object.keys(req.session || {});
|
|
|
let backSessionKeys = Object.keys(req.session2.sessionBack || {});
|
|
|
|
|
|
if (backSessionKeys.length > sessionKeys.length) {
|
|
|
let differences = _.difference(backSessionKeys, sessionKeys);
|
|
|
|
|
|
_.forEach(differences, d => {
|
|
|
req.session[d] = req.session2.sessionBack[d];
|
|
|
});
|
|
|
}
|
|
|
req.session2.sessionBack = req.session;
|
|
|
} else {
|
|
|
req.session = new memcachedSession.Session(req);
|
|
|
req.session = _.assign(req.session, req.session2.sessionBack);
|
|
|
}
|
|
|
// if (req.session) {
|
|
|
// let sessionKeys = Object.keys(req.session || {});
|
|
|
// let backSessionKeys = Object.keys(req.session2.sessionBack || {});
|
|
|
|
|
|
// if (backSessionKeys.length > sessionKeys.length) {
|
|
|
// let differences = _.difference(backSessionKeys, sessionKeys);
|
|
|
|
|
|
// _.forEach(differences, d => {
|
|
|
// req.session[d] = req.session2.sessionBack[d];
|
|
|
// });
|
|
|
// }
|
|
|
// req.session2.sessionBack = req.session;
|
|
|
// } else {
|
|
|
// req.session = new memcachedSession.Session(req);
|
|
|
// req.session = _.assign(req.session, req.session2.sessionBack);
|
|
|
// }
|
|
|
|
|
|
if (!req.sessionID) {
|
|
|
req.sessionID = uuid.v4();
|
...
|
...
|
|