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

useCookie doesn't change value of an object stored in cookie #24969

Closed
GhostvOne opened this issue Dec 30, 2023 · 2 comments · Fixed by #25007
Closed

useCookie doesn't change value of an object stored in cookie #24969

GhostvOne opened this issue Dec 30, 2023 · 2 comments · Fixed by #25007

Comments

@GhostvOne
Copy link

GhostvOne commented Dec 30, 2023

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.9.0
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: npm@9.4.2
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-4fsr9x?file=app.vue

Describe the bug

Same as #22001
When I store an object in a cookie using useCookie composable and then want to change the value of a key of that object it doesn't effect the cookie in the web browser. The value in the ref is good but value registered in the cookie browser it not updated.

Additional context

No response

Logs

No response

Copy link

stackblitz bot commented Dec 30, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@manniL manniL changed the title useCookie doesn't change value of an object stored in cookie RE#22001 useCookie doesn't change value of an object stored in cookie Jan 1, 2024
@Ganthology
Copy link

Hi, I tested the repro locally on my mac machine and it seems to be working fine.

Not sure if it's stackblitz behaviour that did not update the cookies correctly in browser, here's a stackblitz repro from another issue related to cookie that I tested.

Attached is a demo of me running the repro locally, can notice that the cookie did update when I click refresh after hitting the button.
Hope it helps!

Screen.Recording.2024-01-02.at.10.59.32.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants