[r206 32bit] LocalStorage seams to be a 'session' storage

Bugs will be moved here once resolved.

Post » Wed Jun 17, 2015 10:35 am

Problem Description
Localstorage get lost if session is closed.

Attach a Capx
http://www.file-upload.net/download-106 ... .capx.html

Description of Capx
Set & read a Localstorage (key 'test') with 2 buttons

Steps to Reproduce Bug
  • Press the 'SET' button and wait until the text (behind the 'LOAD' button) is set to the value (behind the 'SET' button)
  • Close the browser (use IE, because Firefox crashes) and wait some seconds
  • Open again and press the 'LOAD' button -> noting happens

Observed Result
A set localstorage key-value can't be re-read after a session was closed (same browser)

Expected Result
A saved key-value should be permanent and re-read within a new session (same browser)

Affected Browsers
  • Chrome: (?)
  • FireFox: (crashes when set - other bug)
  • Internet Explorer: (YES)

Operating System and Service Pack
Win7/64 SP2
IE11 build 11.0.96

Construct 2 Version ID
206
Image Image Image
B
42
S
22
G
15
Posts: 375
Reputation: 12,221

Post » Wed Jun 17, 2015 7:53 pm

You were not retrieving correctly. I made some small mods here.

https://www.dropbox.com/s/yyt2wl382jund ... .capx?dl=0
B
42
S
16
G
3
Posts: 169
Reputation: 4,383

Post » Thu Jun 18, 2015 2:20 am

Created a capx to show more people how to use local storage with dictionary if you are interested.

viewtopic.php?f=159&t=148416
B
42
S
16
G
3
Posts: 169
Reputation: 4,383

Post » Thu Jun 18, 2015 6:09 am

CDogs1964 wrote:You were not retrieving correctly. I made some small mods here.

https://www.dropbox.com/s/yyt2wl382jund ... .capx?dl=0


So you mean LocalStorage must be checked/loaded with the 'on Start of Layout' event (start of the app)?
@ashlay - is this the way it works? All LocalStorage values have to be processed with game start?
For me this is a bit too inflexible.

Btw.: this solution works for me nether - if i wait for about 5-10 sec. before i restart the app the localstorage value is gone...
Image Image Image
B
42
S
22
G
15
Posts: 375
Reputation: 12,221

Post » Thu Jun 18, 2015 10:19 am

Can't reproduce, works fine in Firefox here. Check you're not using any privacy browser addons or private browsing modes, which may clear the storage. I'm not sure why you would use "check item exists" in an "on item set" trigger anyway - of course it exists if it's just been set!
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests