Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Web browser game randomly losing localStorage data?

A topic by Scott created 22 hours ago Views: 71 Replies: 5
Viewing posts 1 to 4
(2 edits)

Update: I don't think this is being caused by itch. I think it's something to do with Brave (or my Brave settings) and the fact the game is loaded in an iframe, as I've repeated the process on Edge and haven't had the issue on it for a good while (and it was pretty frequent).

Hi all!

I've moved a couple of web games from my own site to itch.io. They use localStorage to save progress. I'm finding that once in a while like every half hour or so the local storage data is just... gone.

itch seems to use html-classic.itch.zone for hosting the actual game, and that's not changing. So the only thing I can think of is that localStorage is being explicitly cleared by a script on html-classic.itch.zone, or maybe somehow my browser is dong it, or maybe I'm doing something wrong (but I've re-checked several times I never noticed this issue before the move).

Has anyone else experienced this? If I know it's a known thing I can start doing something about it. If it's not a known thing then it must be something I'm doing lol.

I've seen some other topics about it, they mention the transition from some other CDN to html-classic but the conclusion of the other topics seem to be that localStorage should be working as normal under the new html-classic.itch.zone domain.

(+1)

For reference, I just checked some saves from some games with Twine and they're all still there (they're several months old).

I also tried a game I created and the save is still in the localstore without any issues (and they're also a few months old).

I don't think it's anything server-side.

Thank you, that's useful info! Now I know at least one other is using localStorage without any issues.

I'm starting to lean towards thinking it's something my end, unfortunately I've been unable to figure out the steps to make it happen yet, it just seems to happen randomly. xD

If anyone else has any insights, I'd greatly appreciate it.

And if I figure out what's happening myself, I'll report back for others who may encounter a similar issue in the future (even if it does turn out to be my end haha).

Update: I don't think this is being caused by itch. I think it's something to do with Brave (or my Brave settings) and the fact the game is loaded in an iframe, as I've repeated the process on Edge and haven't had the issue on it for a good while (and it was pretty frequent). I've updated the OG post in case someone stumbles across this post via Google or something lol.

(+1)

The problem appears to be this “ephemeral site storage” feature in Brave.

https://brave.com/privacy-updates/7-ephemeral-storage/ (2021)

You can change the ephemeral storage setting by going to brave://flags and toggling the Enable Ephemeral Storage option.

https://dev-pages.bravesoftware.com/storage/ephemeral-storage.html

Interesting! Thank you I will look into this!