Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] Deprecate res.clearCookie accepting options.maxAge and options.expires #5672

Merged

Conversation

jonchurch
Copy link
Member

@jonchurch jonchurch commented May 18, 2024

closes #5640

Adds a deprecation notice when users pass a truthy value in options for maxAge or expires when calling res.clearCookie(name, options).

example:

res.clearCookie: Passing "options.maxAge" is deprecated and should be removed. Starting with the next major release of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.

Related #4852

lib/response.js Outdated Show resolved Hide resolved
lib/response.js Outdated Show resolved Hide resolved
@jonchurch jonchurch requested a review from wesleytodd May 25, 2024 22:22
lib/response.js Show resolved Hide resolved
lib/response.js Outdated Show resolved Hide resolved
Copy link
Member

@ctcpip ctcpip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. minor suggestion

lib/response.js Outdated Show resolved Hide resolved
Co-authored-by: Chris de Almeida <ctcpip@users.noreply.github.com>
@jonchurch jonchurch merged commit f42b160 into expressjs:master Jun 7, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v4] Deprecate res.clearCookie taking maxAge and expires parameters
3 participants