|
@@ -17,9 +17,8 @@ const path = require('path'); |
|
@@ -17,9 +17,8 @@ const path = require('path'); |
17
|
const bodyParser = require('body-parser');
|
17
|
const bodyParser = require('body-parser');
|
18
|
const cookieParser = require('cookie-parser');
|
18
|
const cookieParser = require('cookie-parser');
|
19
|
const favicon = require('serve-favicon');
|
19
|
const favicon = require('serve-favicon');
|
20
|
-const session = require('yoho-express-session');
|
|
|
21
|
-const memcached = require('yoho-connect-memcached');
|
|
|
22
|
-const uuid = require('uuid');
|
20
|
+const session = require('express-session');
|
|
|
21
|
+const memcached = require('connect-memcached');
|
23
|
const _ = require('lodash');
|
22
|
const _ = require('lodash');
|
24
|
const pkg = require('./package.json');
|
23
|
const pkg = require('./package.json');
|
25
|
const cookie = require('./library/cookie');
|
24
|
const cookie = require('./library/cookie');
|
|
@@ -50,19 +49,15 @@ app.use(session({ |
|
@@ -50,19 +49,15 @@ app.use(session({ |
50
|
resave: false,
|
49
|
resave: false,
|
51
|
saveUninitialized: true,
|
50
|
saveUninitialized: true,
|
52
|
unset: 'destroy',
|
51
|
unset: 'destroy',
|
53
|
- secret: 'nothing', // 兼容 PHP SESSION,sessionID 不加密
|
|
|
54
|
- name: 'PHPSESSID', // 兼容 PHP SESSION
|
|
|
55
|
- genid: () => {
|
|
|
56
|
- return uuid.v4(); // 兼容 PHP SESSION
|
|
|
57
|
- },
|
52
|
+ secret: '82dd7e724f2c6870472c89dfa43cf48d',
|
|
|
53
|
+ name: 'yohobuy_session',
|
58
|
cookie: {
|
54
|
cookie: {
|
59
|
- domain: 'yohobuy.com',
|
55
|
+ // domain: 'yohobuy.com',
|
60
|
httpOnly: false
|
56
|
httpOnly: false
|
61
|
},
|
57
|
},
|
62
|
store: new MemcachedStore({
|
58
|
store: new MemcachedStore({
|
63
|
hosts: config.memcache.session,
|
59
|
hosts: config.memcache.session,
|
64
|
- prefix: 'qinsessionsession:', // 兼容 PHP SESSION
|
|
|
65
|
- key: 'yohobuy_session' // 兼容 PHP SESSION
|
60
|
+ prefix: 'yohobuy_session:'
|
66
|
})
|
61
|
})
|
67
|
}));
|
62
|
}));
|
68
|
|
63
|
|