edge-runtime icon indicating copy to clipboard operation
edge-runtime copied to clipboard

fix(cookies): set options when deleting cookies

Open nonoakij opened this issue 1 year ago • 3 comments

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'>.

nonoakij avatar May 14 '24 07:05 nonoakij

🦋 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

changeset-bot[bot] avatar May 14 '24 07:05 changeset-bot[bot]

@nonoakij is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 14 '24 07:05 vercel[bot]

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

vercel[bot] avatar Oct 07 '24 09:10 vercel[bot]

Thanks @nonoakij; Would it be possible to add a test here to verify what is this PR fixing? 🙏

Kikobeats avatar Oct 07 '24 10:10 Kikobeats

@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.

nonoakij avatar Oct 09 '24 06:10 nonoakij