Hi everyone!
I just ran into a bug, where res.clearCookie() does not work properly.
What happen?
According to the typescript definitions, res.clearCookie() accepts CookieOptions as a second parameter (see here) which includes the maxAge attribute. But if the maxAge is set, the cookie won't be deleted.
What do I expect?
.clearCookie()should ignore (or delete) the maxAge attribute, because it is used to calculate the expire attribute afterwards in .cookie();
Research
I already located the bug and would like to provide a pr to fix this.
Hi everyone!
I just ran into a bug, where
res.clearCookie()does not work properly.What happen?
According to the typescript definitions,
res.clearCookie()acceptsCookieOptionsas a second parameter (see here) which includes themaxAgeattribute. But if themaxAgeis set, the cookie won't be deleted.What do I expect?
.clearCookie()should ignore (or delete) themaxAgeattribute, because it is used to calculate theexpireattribute afterwards in.cookie();Research
I already located the bug and would like to provide a pr to fix this.