Skip to content

Commit

Permalink
Use AstroCookieSetOptions to construct AstroCookieDeleteOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
fshafiee committed Apr 8, 2024
1 parent 6035992 commit 58e6fed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .changeset/shaggy-cats-film.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
"astro": patch
"astro": minor
---

Accept standard cookie attributes when deleting a cookie
Extends the acceptable cookie options when deleting a cookie, to the following attribute:

- `domain`
- `path`
- `httpOnly` *(Added)*
- `sameSite` *(Added)*
- `secure` *(Added)*
2 changes: 1 addition & 1 deletion packages/astro/src/core/cookies/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface AstroCookieGetOptions {
decode?: (value: string) => string;
}

type AstroCookieDeleteOptions = Omit<CookieSerializeOptions, 'expires' | 'maxAge'>;
type AstroCookieDeleteOptions = Omit<AstroCookieSetOptions, 'expires' | 'maxAge' | 'encode'>;

interface AstroCookieInterface {
value: string;
Expand Down

0 comments on commit 58e6fed

Please sign in to comment.