Skip to content

Commit 48dfbd5

Browse files
committed
explicitly delete maxAge instead of setting as undefined
1 parent 6a0a534 commit 48dfbd5

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
@@ -708,8 +708,9 @@ res.get = function(field){
708708

709709
res.clearCookie = function clearCookie(name, options) {
710710
// Force cookie expiration by setting expires to the past
711-
// ensure maxAge is undefined
712-
const opts = {path: '/', ...options, expires: new Date(1), maxAge: undefined}
711+
const opts = { path: '/', ...options, expires: new Date(1) }
712+
// ensure maxAge is not passed
713+
delete opts.maxAge
713714

714715
return this.cookie(name, '', opts);
715716
};

0 commit comments

Comments
 (0)