fix(cookies): set options when deleting cookies #890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes vercel/next.js#56632
This PR allows the setting of other attributes such as the secure attribute along with domain and path. This adjustment ensures that cookies prefixed with __Secure- can be appropriately deleted.
The W3C's CookieStore#delete is defined as, "Let r be the result of running delete a cookie with url, options["name"], options["domain"], options["path"], and options["partitioned"]."
This PR enables setting attributes beyond those specified.
If it is necessary to align with the CookieStore#delete standard, I think that the options type should be changed to Pick<ResponseCookie, 'name' | 'domain' | 'path' | 'partitioned'>.