Skip to content

Commit 4668a6e

Browse files
committed
explicitly delete maxAge instead of setting as undefined
1 parent bcf4b07 commit 4668a6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/response.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,9 @@ res.get = function(field){
698698

699699
res.clearCookie = function clearCookie(name, options) {
700700
// Force cookie expiration by setting expires to the past
701-
// ensure maxAge is undefined
702-
const opts = {path: '/', ...options, expires: new Date(1), maxAge: undefined}
701+
const opts = { path: '/', ...options, expires: new Date(1) }
702+
// ensure maxAge is not passed
703+
delete opts.maxAge
703704

704705
return this.cookie(name, '', opts);
705706
};

0 commit comments

Comments
 (0)