- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a token that I am trying to store into session storage so that it is cleared after each time the app is restarted but the toke persists even after i close and reopen the simulator.
here is my code for the storage
sessionStorage.setItem("url", "http://robbotdev.com");
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot reproduce this. When I close the simulator and reopen the data in sessionStorage is deleted.
To test this, I made a couple of small modifications to the blank html5 template project of the Intel XDK as follows:
In index.html
<p id="p1">Hello, Intel XDK!</p> <button onclick="testFunction()"> Test </button>
In app.js
function testFunction() { var name = "none"; if(sessionStorage.getItem("name")) { name = sessionStorage.getItem("name"); } document.getElementById("p1").innerHTML= "Hello " + name; sessionStorage.setItem("name", "John"); }
The first time you click on the button it shows "Hello none", but in consequent calls it shows "Hello John". After closing and restarting the simulator, the first time it shows "Hello none" again.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot reproduce this. When I close the simulator and reopen the data in sessionStorage is deleted.
To test this, I made a couple of small modifications to the blank html5 template project of the Intel XDK as follows:
In index.html
<p id="p1">Hello, Intel XDK!</p> <button onclick="testFunction()"> Test </button>
In app.js
function testFunction() { var name = "none"; if(sessionStorage.getItem("name")) { name = sessionStorage.getItem("name"); } document.getElementById("p1").innerHTML= "Hello " + name; sessionStorage.setItem("name", "John"); }
The first time you click on the button it shows "Hello none", but in consequent calls it shows "Hello John". After closing and restarting the simulator, the first time it shows "Hello none" again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for replaying Shahab! After I restarted the program this error seems to have gone away
![](/skins/images/7B0AB6865064EAE32B30EC9A4E94B48A/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page