|
@@ -41,15 +41,22 @@ app.use(bodyParser.json()); |
|
@@ -41,15 +41,22 @@ app.use(bodyParser.json()); |
41
|
app.use(bodyParser.urlencoded({extended: false}));
|
41
|
app.use(bodyParser.urlencoded({extended: false}));
|
42
|
app.use(cookieParser());
|
42
|
app.use(cookieParser());
|
43
|
app.use(session({
|
43
|
app.use(session({
|
|
|
44
|
+ proxy: true,
|
|
|
45
|
+ resave: false,
|
|
|
46
|
+ saveUninitialized: true,
|
|
|
47
|
+ unset: 'destroy',
|
44
|
secret: 'nothing', // 兼容 PHP SESSION,sessionID 不加密
|
48
|
secret: 'nothing', // 兼容 PHP SESSION,sessionID 不加密
|
45
|
name: 'PHPSESSID', // 兼容 PHP SESSION
|
49
|
name: 'PHPSESSID', // 兼容 PHP SESSION
|
46
|
genid: () => {
|
50
|
genid: () => {
|
47
|
return uuid.v4(); // 兼容 PHP SESSION
|
51
|
return uuid.v4(); // 兼容 PHP SESSION
|
48
|
},
|
52
|
},
|
49
|
- proxy: true,
|
|
|
50
|
- resave: false,
|
|
|
51
|
- saveUninitialized: true,
|
|
|
52
|
- unset: 'destroy',
|
53
|
+ cookie: {
|
|
|
54
|
+ domain: 'yohobuy.com',
|
|
|
55
|
+ path: '/',
|
|
|
56
|
+ httpOnly: true,
|
|
|
57
|
+ secure: false,
|
|
|
58
|
+ maxAge: null
|
|
|
59
|
+ },
|
53
|
store: new MemcachedStore({
|
60
|
store: new MemcachedStore({
|
54
|
hosts: config.memcache.session,
|
61
|
hosts: config.memcache.session,
|
55
|
prefix: 'qinsessionsession:', // 兼容 PHP SESSION
|
62
|
prefix: 'qinsessionsession:', // 兼容 PHP SESSION
|