Authored by ccbikai(👎🏻🍜)

使用uuid

... ... @@ -87,6 +87,9 @@ app.use(MemcachedSession({
domain: 'yohobuy.com',
httpOnly: false
},
genid() {
return uuid.v4() // use UUIDs for session IDs
},
store: new MemcachedStore({
hosts: config.memcache.session,
prefix: 'yohobuy_session:',
... ... @@ -122,7 +125,7 @@ app.use((req, res, next) => {
if (typeof req.session.reset !== 'function') {
req.session.reset = function() {
req.session = null;
req.session.destroy();
req.session2.reset();
};
}
... ...
... ... @@ -19,6 +19,9 @@ module.exports = () => {
req.user.uid = cookie.getUid(req);
}
console.log('======', req.session)
console.log('======', req.user)
next();
};
};
... ...