Specify Cookie domain with hostname

This commit is contained in:
Akihiko Odaki
2018-03-26 13:21:41 +09:00
parent a23790a1e8
commit 0109e0811c
4 changed files with 6 additions and 3 deletions

View File

@@ -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),