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

Secure Cookies can't be deleted from Responses

Open fea17e86 opened this issue 2 years ago • 0 comments

Bug Report

Current behavior

Using ResponseCookies.delete({ name: '__Secure-some-cookie', secure: true }) to delete a secure cookie fails. The cookie simply doesn't get deleted.

Expected behavior/code

The cookie should get deleted.

Possible solution

Pass all options given to delete to the contained set call.

Additional context/screenshots

Investigating the code, I found that the secure flag, that can be passed as an option to delete isn't passed to the set call.

https://github.com/vercel/edge-runtime/blob/0b9479af1c778f26d63d12e08af7235f5df46828/packages/cookies/src/response-cookies.ts#L94

In general, please don't offer parameters for the function that have 0 influence on the execution.

fea17e86 avatar Dec 07 '23 07:12 fea17e86