question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useCookie nuxt options

See original GitHub issue

Describe 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.

image

Passing this doesn’t work image

{ 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:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
prazdevscommented, Jul 30, 2022

V2 is now released and it should be fixed!

0reactions
stephenjason89commented, Jul 30, 2022

Thanks @prazdevs

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found