Skip to content

Commit

Permalink
Update cookies.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
baozhoutao committed Dec 12, 2024
1 parent 8993557 commit ca6b75b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utils/src/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function getSubdomain(host) {
}

export function setCookie(req, res, name, value, options = {domain: null, maxAge: 0, httpOnly: true, overwrite: true}) {
const cookies = new Cookies(req, res, {secure: true});
const cookies = new Cookies(req, res);
const host = req.headers.host;
if(host && useSubdomainCookies && psl.isValid(host)){
const domain = getSubdomain(host);
Expand All @@ -32,7 +32,7 @@ export function setCookie(req, res, name, value, options = {domain: null, maxAge
}

export function clearCookie(req, res, name, options = {domain: null, maxAge: 0, httpOnly: true, overwrite: true}) {
const cookies = new Cookies(req, res, {secure: true});
const cookies = new Cookies(req, res);
const host = req.headers.host;
if(host && useSubdomainCookies && psl.isValid(host)){
const domain = getSubdomain(host);
Expand Down

0 comments on commit ca6b75b

Please sign in to comment.