---
title: "useCookie"
description: "This example shows how to use the useCookie API to persist small amounts of data that both client and server can use."
canonical_url: "https://nuxt.com/docs/3.x/examples/advanced/use-cookie"
---
# useCookie

> This example shows how to use the useCookie API to persist small amounts of data that both client and server can use.

<code-explorer default-value="app.vue" path="examples/advanced/use-cookie">



</code-explorer>

<browser src="https://use-cookie.example.nuxt.space">



</browser>

<read-more to="https://nuxt.com/docs/3.x/api/composables/use-cookie">



</read-more>

---

- [Source](https://github.com/nuxt/examples/tree/main/examples/advanced/use-cookie)


## Sitemap

See the full [sitemap](https://nuxt.com/sitemap.md) for all pages.
