Skip to content
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

docs: add cookie max size info #343

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/frameworks/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export const useStore = defineStore('main', {
> - [`sameSite`](https://nuxt.com/docs/api/composables/use-cookie#samesite)
> - [`secure`](https://nuxt.com/docs/api/composables/use-cookie#secure)

> [!WARNING]
> Be careful when saving stores with a lot of data as cookie size is **limited to 4098 bytes**. More on cookie storage in [the MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#data_storage).

### `localStorage`

```ts{10}
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ features:
icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="currentColor"><path d="M25.53 24.08c.44.44 1.14.44 1.58 0s.44-1.15 0-1.58L21 16.39a1.11 1.11 0 0 0-1.58 0a1.11 1.11 0 0 0 0 1.58zm-3.03 3.03c.44.44 1.14.44 1.58 0c.43-.43.43-1.14 0-1.58l-6.11-6.11a1.11 1.11 0 0 0-1.58 0a1.11 1.11 0 0 0 0 1.58z"/><path d="m2.12 3.47l1.35-1.35c.13-.13.33-.16.48-.06L7.7 4.31c.29.17.46.48.46.81v.86c0 .25.1.49.28.67l6.153 6.162l1.59-1.59a2.49 2.49 0 0 1 3.534 0l.006.006c.422.43.66.975.71 1.534c.59.079 1.159.346 1.614.8l8.13 8.13a2.805 2.805 0 0 1-.003 3.977l-.002.003l-4.505 4.505a2.805 2.805 0 0 1-3.975 0l-8.13-8.13a2.8 2.8 0 0 1-.8-1.616a2.5 2.5 0 0 1-1.53-.724a2.49 2.49 0 0 1 0-3.535l1.57-1.57L6.64 8.44a.95.95 0 0 0-.67-.28h-.86c-.33 0-.64-.17-.81-.46L2.06 3.95c-.1-.15-.07-.35.06-.48m17.449 11.435l-4.664 4.664a.804.804 0 0 0 .072 1.063l8.13 8.13c.32.32.826.32 1.146 0l4.514-4.515a.805.805 0 0 0-.005-1.14l-8.13-8.13a.804.804 0 0 0-1.063-.072m-1.276-1.553c.199-.2.2-.518.006-.718a.49.49 0 0 0-.702.003l-4.95 4.95c-.2.2-.2.506 0 .705c.2.2.506.2.705 0l.073-.072q.065-.076.137-.148l4.51-4.51q.073-.072.148-.137z"/></g></svg>
- title: Nuxt support
details: Out of the box SSR support for Nuxt with cookies.
link: /nuxt
link: /frameworks/nuxt
linkText: Usage with Nuxt
icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="2 2 20 20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.146 8.583l-1.3-2.09a1.046 1.046 0 0 0-1.786.017l-5.91 9.908A1.046 1.046 0 0 0 4.047 18H7.96m12.083 0c.743 0 1.201-.843.82-1.505l-4.044-7.013a.936.936 0 0 0-1.638 0l-4.043 7.013c-.382.662.076 1.505.819 1.505z"/></svg>
- title: Smol
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ features:
icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="currentColor"><path d="M25.53 24.08c.44.44 1.14.44 1.58 0s.44-1.15 0-1.58L21 16.39a1.11 1.11 0 0 0-1.58 0a1.11 1.11 0 0 0 0 1.58zm-3.03 3.03c.44.44 1.14.44 1.58 0c.43-.43.43-1.14 0-1.58l-6.11-6.11a1.11 1.11 0 0 0-1.58 0a1.11 1.11 0 0 0 0 1.58z"/><path d="m2.12 3.47l1.35-1.35c.13-.13.33-.16.48-.06L7.7 4.31c.29.17.46.48.46.81v.86c0 .25.1.49.28.67l6.153 6.162l1.59-1.59a2.49 2.49 0 0 1 3.534 0l.006.006c.422.43.66.975.71 1.534c.59.079 1.159.346 1.614.8l8.13 8.13a2.805 2.805 0 0 1-.003 3.977l-.002.003l-4.505 4.505a2.805 2.805 0 0 1-3.975 0l-8.13-8.13a2.8 2.8 0 0 1-.8-1.616a2.5 2.5 0 0 1-1.53-.724a2.49 2.49 0 0 1 0-3.535l1.57-1.57L6.64 8.44a.95.95 0 0 0-.67-.28h-.86c-.33 0-.64-.17-.81-.46L2.06 3.95c-.1-.15-.07-.35.06-.48m17.449 11.435l-4.664 4.664a.804.804 0 0 0 .072 1.063l8.13 8.13c.32.32.826.32 1.146 0l4.514-4.515a.805.805 0 0 0-.005-1.14l-8.13-8.13a.804.804 0 0 0-1.063-.072m-1.276-1.553c.199-.2.2-.518.006-.718a.49.49 0 0 0-.702.003l-4.95 4.95c-.2.2-.2.506 0 .705c.2.2.506.2.705 0l.073-.072q.065-.076.137-.148l4.51-4.51q.073-.072.148-.137z"/></g></svg>
- title: Nuxt 支持
details: 对带有 cookie 的 Nuxt 的开箱即用 SSR 支持。
link: /zh/nuxt
link: /zh/frameworks/nuxt
linkText: 在 Nuxt 中使用
icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="2 2 20 20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.146 8.583l-1.3-2.09a1.046 1.046 0 0 0-1.786.017l-5.91 9.908A1.046 1.046 0 0 0 4.047 18H7.96m12.083 0c.743 0 1.201-.843.82-1.505l-4.044-7.013a.936.936 0 0 0-1.638 0l-4.043 7.013c-.382.662.076 1.505.819 1.505z"/></svg>
- title: 更轻盈
Expand Down