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

Cookie storage creates duplicate cookies with path information on nested routes causing conflict #303

Open
Coops0 opened this issue Nov 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Coops0
Copy link

Coops0 commented Nov 8, 2024

Version

@nuxtjs/color-mode: 3.5.2
nuxt: 4.0.0-28849585.4751b054 (but this is the same on the latest stable Nuxt v3 version, the repo is on v3 too)

Reproduction Link

github repo

Steps to reproduce

  1. Setup the repo above
  2. Switching the theme on the main page works fine. The cookie persists, and loads properly. (delete the cookie to reset)
  3. Navigate to the nested route, and change the theme. Note in your browser's cookies that it has created 2 cookies with the same name and different paths.
  4. Refresh. This will cause conflicts.

What is Expected?

Cookie persistence to not retain any path information.

What is actually happening?

Image

@Coops0 Coops0 added the bug Something isn't working label Nov 8, 2024
@Coops0
Copy link
Author

Coops0 commented Nov 8, 2024

It appears that #301 will resolve this with the ability to hardcode the path value.

@tasiotas
Copy link

I concur, currently it saves cookie per route. I doubt that was the intended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants