Local storage not unique per game?

Discussion and feedback on Construct 2

Post » Sun Feb 28, 2016 8:35 pm

In the manual states:

Different browsers use different storages, so data is not shared between different browsers on the same computer - each browser has its own unique storage.


I think it was unique per game as well before(?). Now I just checked my second game with debug mode and when I lookup the LocalStorage object, it contains data from my other game.

Is it a bug or should we always give some unique prefix per game? Or is it only an issue on localhost?
ImageImageImage
B
45
S
23
G
89
Posts: 1,100
Reputation: 50,611

Post » Sun Feb 28, 2016 8:46 pm

You should give it a unique key name.
On the other hand you can have different games share data that way.
Image ImageImage
B
178
S
50
G
206
Posts: 8,686
Reputation: 127,715

Post » Sun Feb 28, 2016 8:51 pm

Hmmm... that's actually a good news. Thanks newt! ;)
ImageImageImage
B
45
S
23
G
89
Posts: 1,100
Reputation: 50,611

Post » Mon Feb 29, 2016 5:52 am

I thought this was linked to the ID (ie. com.blah.game) in the project settings as well the Project Name?

I've had instances in the past, where I change those, and the LocalStorage is no longer accessible. But if I rename it back, it works and retrieves data ok.
B
72
S
25
G
20
Posts: 1,762
Reputation: 18,314

Post » Mon Feb 29, 2016 8:32 am

I know if you change the project name it will be a different save data. I use that to test stuff I don't want messing with my main save.
B
12
S
4
G
1
Posts: 137
Reputation: 1,519


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests