summaryrefslogtreecommitdiff
path: root/.changeset/thin-news-collect.md
diff options
context:
space:
mode:
authorGravatar Fred K. Bot <108291165+fredkbot@users.noreply.github.com> 2022-09-29 08:20:00 -0700
committerGravatar GitHub <noreply@github.com> 2022-09-29 11:20:00 -0400
commitd08093f7d4f9762c0edc71e14c796d7ea8038cda (patch)
treefae95330db4aeaf16841e16bd24c24e61c11c107 /.changeset/thin-news-collect.md
parent10317c65feefd34a2b4b6142a4bdd1f1cc19f58e (diff)
downloadastro-d08093f7d4f9762c0edc71e14c796d7ea8038cda.tar.gz
astro-d08093f7d4f9762c0edc71e14c796d7ea8038cda.tar.zst
astro-d08093f7d4f9762c0edc71e14c796d7ea8038cda.zip
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Diffstat (limited to '.changeset/thin-news-collect.md')
-rw-r--r--.changeset/thin-news-collect.md48
1 files changed, 0 insertions, 48 deletions
diff --git a/.changeset/thin-news-collect.md b/.changeset/thin-news-collect.md
deleted file mode 100644
index 7779013b8..000000000
--- a/.changeset/thin-news-collect.md
+++ /dev/null
@@ -1,48 +0,0 @@
----
-'astro': minor
-'@astrojs/cloudflare': minor
-'@astrojs/deno': minor
-'@astrojs/netlify': minor
-'@astrojs/node': minor
-'@astrojs/vercel': minor
----
-
-Adds the Astro.cookies API
-
-`Astro.cookies` is a new API for manipulating cookies in Astro components and API routes.
-
-In Astro components, the new `Astro.cookies` object is a map-like object that allows you to get, set, delete, and check for a cookie's existence (`has`):
-
-```astro
----
-type Prefs = {
- darkMode: boolean;
-}
-
-Astro.cookies.set<Prefs>('prefs', { darkMode: true }, {
- expires: '1 month'
-});
-
-const prefs = Astro.cookies.get<Prefs>('prefs').json();
----
-<body data-theme={prefs.darkMode ? 'dark' : 'light'}>
-```
-
-Once you've set a cookie with Astro.cookies it will automatically be included in the outgoing response.
-
-This API is also available with the same functionality in API routes:
-
-```js
-export function post({ cookies }) {
- cookies.set('loggedIn', false);
-
- return new Response(null, {
- status: 302,
- headers: {
- Location: '/login'
- }
- });
-}
-```
-
-See [the RFC](https://github.com/withastro/rfcs/blob/main/proposals/0025-cookie-management.md) to learn more.