Local Storage clearing after refresh?

We are seeing an issue where local storage (Data Store component) is being emptied upon reload, or browsing to another page, for some reason? There is no clearing of storage happening within the pages themselves. Has anyone experienced this?

Are you sure you are using local storage and not session storage?
Do you see the data after page reload in the dev tools > app > local storage? What’s the code which adds the data to the local storage exactly (paste it here please)?

And it would be best if we can test this on your live URL.

Thanks Teodor,
Yes local storage not session, code below, on button click:

dmx-on:click="CartContents.upsert({product: SelectedVariationCart.data.VariationSelected[0].uid},{product: SelectedVariationCart.data.VariationSelected[0].uid, price: SelectedVariationCart.data.VariationSelected[0].varprice, quantity: quantity.value, item: SelectedVariationCart.data.VariationSelected[0].vartext, store: SelectedVariationCart.data.VariationSelected[0].store, itemimagepath: SelectedVariationCart.data.VariationSelected[0].varimage})"

Everything goes in correctly, the next item, quantity changes, etc. Persists for one page and then is removed? Will PM you access.

Thanks again!

We fixed it! The clients template had a debug option hidden away in a custom.js file which when set to true cleared the local storage!

Bloody templates arrrghhh!

1 Like