Specify Cookie domain with hostname
This commit is contained in:
parent
a23790a1e8
commit
0109e0811c
4 changed files with 6 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ export default function(res, user, redirect: boolean) {
|
|||
const expires = 1000 * 60 * 60 * 24 * 365; // One Year
|
||||
res.cookie('i', user.token, {
|
||||
path: '/',
|
||||
domain: `.${config.host}`,
|
||||
domain: `.${config.hostname}`,
|
||||
secure: config.url.substr(0, 5) === 'https',
|
||||
httpOnly: false,
|
||||
expires: new Date(Date.now() + expires),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue