Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
7 years ago
Commit
a5632bb78e653aeea7d0f6ac956c7167349e7a4c
1 parent
87c2d780
http-only
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
apps/passport/models/auth-helper.js
doraemon/middleware/yoho-session.js
apps/passport/models/auth-helper.js
View file @
a5632bb
...
...
@@ -147,8 +147,7 @@ class AuthModel extends global.yoho.BaseModel {
res
.
cookie
(
'_SESSION_KEY'
,
authcode
(
sessionKey
,
'_SESSION_KEY'
,
2592000000
,
'encode'
),
{
domain
:
'yohobuy.com'
,
expires
:
new
Date
(
Date
.
now
()
+
2592000000
),
// 有效期一年
httpOnly
:
true
,
secure
:
true
httpOnly
:
true
});
userId
.
sessionKey
=
sessionKey
;
}
...
...
doraemon/middleware/yoho-session.js
View file @
a5632bb
...
...
@@ -29,7 +29,7 @@ function yohoSession(opts) {
req
.
session
=
new
memcachedSession
.
Session
(
req
,
req
[
opts
.
backSession
].
sessionBack
);
req
.
session
.
cookie
=
new
memcachedSession
.
Cookie
({
domain
:
'yohobuy.com'
,
httpOnly
:
fals
e
httpOnly
:
tru
e
});
}
...
...
@@ -63,8 +63,7 @@ module.exports = (app) => {
},
cookie
:
{
domain
:
'yohobuy.com'
,
httpOnly
:
true
,
secure
:
true
httpOnly
:
true
},
store
:
new
MemcachedStore
({
hosts
:
config
.
memcache
.
session
,
...
...
@@ -82,8 +81,7 @@ module.exports = (app) => {
cookie
:
{
domain
:
'yohobuy.com'
,
ephemeral
:
true
,
httpOnly
:
true
,
secure
:
true
httpOnly
:
true
}
}));
...
...
Please
register
or
login
to post a comment