-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting domain when deleting cookies #5341
Conversation
🦋 Changeset detectedLatest commit: 01e6d1d The changes in this PR will be included in the next version bump. 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 |
The addition makes sense to me. We will indeed need docs before merging this. The docs for that are here: https://github.com/withastro/docs/blob/da3725bf4e3a24647ee240a3816cc5d72e31d9e6/src/pages/en/reference/api-reference.md#astrocookies |
Pretty sure the tests failing is unrelated to your change and it's a problem in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Should be a
minor
change. - Needs docs
Thanks @alexpdraper, when you have a docs PR please link to that from here. Then the docs team will review it and approve this PR. |
This looks like a useful feature @alexpdraper! You're on our radar now at docs, and we'll be on the lookout for a PR. Please PR a suggested update to this section of the docs: https://docs.astro.build/en/reference/api-reference/#astrocookies (file is at: https://github.com/withastro/docs/blob/main/src/pages/en/reference/api-reference.md ) and we will help over there with final wording, formatting, and just generally squishing it in to that table! |
@alexpdraper Are you planning on making the docs changes? |
Oops, closed by mistake. |
Update with context from withastro/astro#5341
Yes, certainly. Sorry about the delay. @sarah11918 here’s the docs PR withastro/docs#2151 |
Docs PR received! Removing Astro-Docs maintainers requirement for review here, and Docs will take this up over there. 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, this will go out with the next minor (later this week)
Great! Thanks so much! |
Changes
Adds
domain
as a property on the delete cookie options. Without this it wasn’t possible to useAstro.cookies.delete
to delete a cookie that has the domain set.Testing
Added a unit test that checks the domain is added to the set-cookie header when provided, similar to the test for the path option.
Docs
/cc @withastro/maintainers-docs for feedback!
The API reference for
Astro.cookies.delete
doesn’t include the options as one of the arguments.https://github.com/withastro/docs/blob/main/src/pages/en/reference/api-reference.md#astrocookies