Skip to content

Commit e6035e3

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: lib/response.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,9 @@ res.get = function(field){
699699
res.clearCookie = function clearCookie(name, options) {
700700
// Force cookie expiration by setting expires to the past
701701
// ensure maxAge is undefined
702-
const opts = {path: '/', ...options, expires: new Date(1), maxAge: undefined}
702+
const opts = { path: '/', ...options, expires: new Date(1) }
703+
// ensure maxAge is not passed
704+
delete opts.maxAge
703705

704706
return this.cookie(name, '', opts);
705707
};

0 commit comments

Comments
 (0)