fix(cookies): set options when deleting cookies
Fixes https://github.com/vercel/next.js/issues/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'>.
🦋 Changeset detected
Latest commit: dfca0375477c5f772b3b16f64a525bd30c6a454f
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @edge-runtime/cookies | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@nonoakij is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| edge-runtime | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 17, 2024 2:04pm |
Thanks @nonoakij; Would it be possible to add a test here to verify what is this PR fixing? 🙏
@Kikobeats Thanks for your feedback! I've added a test to verify the issue this PR addresses. Please let me know if there are any further changes needed.