Data store and NodeJS do I need to enable something?

I'm going through the shopping cart tutorial and using data store to store the cart data, but if I refresh the page, the data is cleared.

Is there a setting I need to turn on for NodeJS to work? Do I need to enable Redis or is that just for server side?

You need to enable Redis so sessions can be persisted every time NodeJS restarts (every time you change something)

Don't know anything about data store

Thanks for the reply, @Apple for testing I enabled Redis, but doesn't help the data store issue.

What setting is set for your data store? Is it local storage or session storage?

Local

If it's local storage then it should not clear on refresh. Please double check if it's not set to session storage.
Also if local storage is selected, you will see it in Dev Tools under Application > Storage > Local Storage:

Set to local


Please check this

I'm using safari, let me try chrome

Ok, it seems to be Safari. I'm using version 17.4.1 The data store doesn't show up which is why it's gone when I refresh.

I tried in chrome and the data store appears and when I refresh the page, it doesn't clear.

We are referring to browser sessions Apple so redis is, i believe, irrelevant

Yes, I believe so. It appears to be an issue with data store and safari. Chrome works as it should.

Your safari might be restricted in saving cookies and apparently this then effects also local storage in Safari, see:

I checked, it's not restricted. In fact, I have some cookies set on the same page that local storage is, and the cookies work. Just local storage isn't in safari.