Skip to content

res.clearCookie() does not ignore maxAge #4851

@tjarbo

Description

@tjarbo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions