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 9 months 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