useCookie nuxt options
See original GitHub issueDescribe the bug
Can’t set an expires or maxAge option in cookie I need to set expires or maxAge to be able to persist after user has closed the browser.
By default it treats it as a session cookie(“non-persistent-cookie”) and clears upon browser exit.
Passing this doesn’t work
{ expires: 365, secure: true }
Reproduction
use it in nuxt useCookie
System Info
Microsoft Edge
Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
useCookie · Nuxt Composables
Cookie composable accepts several options which let you modify the behavior of cookies. Most of the options will be directly passed to the...
Read more >Proper way to set and remove cookies using useCookie #2576
When nuxt renders the page the cookie is deleted alone, how can I resolve? It is worth punctuating that before the page renders...
Read more >cookie-universal-nuxt - npm
You can use cookie-universal-nuxt to set, get and remove cookies in both client and server side nuxt apps. cookie-universal-nuxt parse ...
Read more >Cookie-universal-nuxt - npm.io
You can use cookie-universal-nuxt to set, get and remove cookies in both client and server side nuxt apps. cookie-universal-nuxt parse cookies with the ......
Read more >Delete a Cookie in Nuxt.js 3 - Stack Overflow
This is how useCookie works in Nuxt 3: To get cookie: const cookie = useCookie(name, options). To set cookie: cookie.value = YOUR_VALUE.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
V2 is now released and it should be fixed!
Thanks @prazdevs