This is a migrated thread and some comments may be shown as answers.

Local Storage Not Cleared when switching simulators

6 Answers 116 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
skobyjay
Top achievements
Rank 1
skobyjay asked on 21 Feb 2013, 05:47 AM
hello,

This might be intentional but I have noticed after I store something in local storage using the code below and I change simulators ( for example iphone to andriod ) the sims are sharing the local storage and the "initial value" isn't set each time I change devices as I would expect (I would expect that "myobject" wouldn't exist in local storage for the newly opened sim since it has not been run yet). In order to work around this I have to close out the IDE completely and reopen to switch devices or I could write code to clear it out regardless each time the page is run.

  if (window.localStorage.getItem("myobject") === null) {
                localStorage.setItem("myobject", "intial value");
            }

6 Answers, 1 is accepted

Sort by
0
Kristina
Telerik team
answered on 21 Feb 2013, 01:50 PM
Hello,

The local storage is per domain and its default behavior is to persist after you refresh, reload, change device info or even close the Simulator. As you suggested, the only way to reset it is through code in you java script file.

Thank you for using Icenium!

 

Regards,
Kristina
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
skobyjay
Top achievements
Rank 1
answered on 21 Feb 2013, 02:17 PM
Shouldn't the local storage be reset if you change devices because that's how it would work in the real world. Every device would have its own local storage 
0
skobyjay
Top achievements
Rank 1
answered on 22 Feb 2013, 03:49 AM
another problem with the local storage not being reset when the simulator window is closed , and you change the underlying data stored in the local storage. then the data property changes are not recognized.
0
Matt
Top achievements
Rank 1
answered on 23 Feb 2013, 02:28 AM
It seems the underlying issue is that we need a way to force a complete reload - reloading all of the files, clearing the UIWebView cache, clearing local storage, etc. Essentially, we want to be able to run our app as if it's the first time it has been loaded on the device. Doing all of that programatically isn't really ideal for a testing / real-world simulation. This is applicable to both the simulator and Ion.
0
skobyjay
Top achievements
Rank 1
answered on 23 Feb 2013, 02:37 AM
I couldn't agree more [quote]Matt said:It seems the underlying issue is that we need a way to force a complete reload - reloading all of the files, clearing the UIWebView cache, clearing local storage, etc. Essentially, we want to be able to run our app as if it's the first time it has been loaded on the device. Doing all of that programatically isn't really ideal for a testing / real-world simulation. This is applicable to both the simulator and Ion.[/quote]
0
Kristina
Telerik team
answered on 25 Feb 2013, 04:48 PM

Hey guys,

Thank you very much for your feedback. We would definitely try to improve the behavior of Simulator Local Storage for one of our next versions. 

Greetings,
Kristina
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
Tags
Report a bug
Asked by
skobyjay
Top achievements
Rank 1
Answers by
Kristina
Telerik team
skobyjay
Top achievements
Rank 1
Matt
Top achievements
Rank 1
Share this question
or