You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come across some strange behavior and have spent many hours trying to debug. At the end, it seems as though setting multiple values in a store in succession causes persistence to fail with cookies?
In this example, any combination of 2 of these lines works properly, but using 3 or more (of any combination), it results in the values of all of them in the cookie being null.
The objects I'm setting are relatively small in kb size.
This is obviously absurd and seems like unlikely behavior, but I've really tried everything to fix it. I'm setting the values from a composable, but I've tried it directly in a component as well.
I'm using 3.2.0, and 2.1.7 of Pinia, with no custom options in nuxt.config, and a basic Setup store:
I encountered a similar issue, and it turned out I was exceeding the cookie size limit of 4096 bytes. Could this be the case for you too? Check the data size stored in the cookie.
I encountered a similar issue, and it turned out I was exceeding the cookie size limit of 4096 bytes. Could this be the case for you too? Check the data size stored in the cookie.
That was exactly my issue as well! I forgot to revisit this to update.
Describe the bug
I've come across some strange behavior and have spent many hours trying to debug. At the end, it seems as though setting multiple values in a store in succession causes persistence to fail with cookies?
In this example, any combination of 2 of these lines works properly, but using 3 or more (of any combination), it results in the values of all of them in the cookie being null.
The objects I'm setting are relatively small in kb size.
This is obviously absurd and seems like unlikely behavior, but I've really tried everything to fix it. I'm setting the values from a composable, but I've tried it directly in a component as well.
I'm using 3.2.0, and 2.1.7 of Pinia, with no custom options in nuxt.config, and a basic Setup store:
If anyone has any ideas of why this might be happening or how I can approach debugging, let me know! Thank you!
Reproduction
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: