Authored by 郭成尧

http-only

@@ -147,8 +147,7 @@ class AuthModel extends global.yoho.BaseModel { @@ -147,8 +147,7 @@ class AuthModel extends global.yoho.BaseModel {
147 res.cookie('_SESSION_KEY', authcode(sessionKey, '_SESSION_KEY', 2592000000, 'encode'), { 147 res.cookie('_SESSION_KEY', authcode(sessionKey, '_SESSION_KEY', 2592000000, 'encode'), {
148 domain: 'yohobuy.com', 148 domain: 'yohobuy.com',
149 expires: new Date(Date.now() + 2592000000), // 有效期一年 149 expires: new Date(Date.now() + 2592000000), // 有效期一年
150 - httpOnly: true,  
151 - secure: true 150 + httpOnly: true
152 }); 151 });
153 userId.sessionKey = sessionKey; 152 userId.sessionKey = sessionKey;
154 } 153 }
@@ -29,7 +29,7 @@ function yohoSession(opts) { @@ -29,7 +29,7 @@ function yohoSession(opts) {
29 req.session = new memcachedSession.Session(req, req[opts.backSession].sessionBack); 29 req.session = new memcachedSession.Session(req, req[opts.backSession].sessionBack);
30 req.session.cookie = new memcachedSession.Cookie({ 30 req.session.cookie = new memcachedSession.Cookie({
31 domain: 'yohobuy.com', 31 domain: 'yohobuy.com',
32 - httpOnly: false 32 + httpOnly: true
33 }); 33 });
34 } 34 }
35 35
@@ -63,8 +63,7 @@ module.exports = (app) => { @@ -63,8 +63,7 @@ module.exports = (app) => {
63 }, 63 },
64 cookie: { 64 cookie: {
65 domain: 'yohobuy.com', 65 domain: 'yohobuy.com',
66 - httpOnly: true,  
67 - secure: true 66 + httpOnly: true
68 }, 67 },
69 store: new MemcachedStore({ 68 store: new MemcachedStore({
70 hosts: config.memcache.session, 69 hosts: config.memcache.session,
@@ -82,8 +81,7 @@ module.exports = (app) => { @@ -82,8 +81,7 @@ module.exports = (app) => {
82 cookie: { 81 cookie: {
83 domain: 'yohobuy.com', 82 domain: 'yohobuy.com',
84 ephemeral: true, 83 ephemeral: true,
85 - httpOnly: true,  
86 - secure: true 84 + httpOnly: true
87 } 85 }
88 })); 86 }));
89 87