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

Global cookieOptions are not applied in Nuxt 3 #291

Open
4 tasks done
rudolfbyker opened this issue Mar 28, 2024 · 3 comments
Open
4 tasks done

Global cookieOptions are not applied in Nuxt 3 #291

rudolfbyker opened this issue Mar 28, 2024 · 3 comments
Labels
🔍️ pending triage This issue needs to be looked into

Comments

@rudolfbyker
Copy link

Describe the bug

When using the exact config from the docs https://prazdevs.github.io/pinia-plugin-persistedstate/frameworks/nuxt-3.html#global-options , where stores use localStorage by default, but some stores are explicitly set to use persist: { storage: persistedState.cookies },, then the cookieOptions seems to be ignored in the stores that use cookies. I still get cookies with Secure:false and SameSite:"None" for those stores.

Reproduction

https://stackblitz.com/edit/github-5b43sb

System Info

Stackblitz

Used Package Manager

npm

Validations

@rudolfbyker rudolfbyker added the 🔍️ pending triage This issue needs to be looked into label Mar 28, 2024
@rudolfbyker
Copy link
Author

rudolfbyker commented Mar 28, 2024

Workaround: Specify this everywhere:

persistedState.cookiesWithOptions({
  sameSite: "strict",
})

instead of

persistedState.cookies

@prazdevs
Copy link
Owner

prazdevs commented Sep 4, 2024

Should be fixed and working in v4

@prazdevs prazdevs closed this as completed Sep 4, 2024
@rudolfbyker
Copy link
Author

This does not seem to work in v4 either. See https://stackblitz.com/edit/github-5b43sb-n4cbn9?file=nuxt.config.ts

@prazdevs prazdevs reopened this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍️ pending triage This issue needs to be looked into
Projects
None yet
Development

No branches or pull requests

2 participants