0
votes

I'm building a HTML5 web application and I want to use local storage. For some reason this code is not working on Windows Phone 8.1 (Nokia Lumia 920):

localStorage.setItem('key', 'value');

I don't get any error in the console, but when I try to get that value from the local storage, it returns null.

1
Nothing here, for example localStorage on wp8 errormplungjan
Can you post the code where you are trying to get the value.Achu

1 Answers

1
votes

if you want to save a key/value inside your app scope, I think you can try the following.

first you tell the application the name of your setting:

Windows.Storage.ApplicationDataContainer yourSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

save:

yourSettings.Values["key"] = myValue;

recover:

var myValue = yourSettings.Values["key"];

It works very well for me. Hope that helps you. Best regards.