0 Favourites

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

  • Problem Description

    Localstorage get lost if session is closed.

    Attach a Capx

    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

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • You were not retrieving correctly. I made some small mods here.

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

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

    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...

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)