Me and my team am preparing to start developing a cross-platform mobile app using ( kendo UI /cordova 3.2.0) ,we need to authenticate the users , we're considering using the LocalStorage to save the authentication status , but I'm reading posts that say that Iphones does not preserve the data stored in the LocalStorage for IOS 5.1 or later . so I created a test app to test the localStorage and it worked fine . so I am wondering if there are any cases where the localStorage fails or if IOS will clear this Data in any case other than uninstalling the app ?.
Thank you ,
here is the code that works.
<div class="view-content">
<label>
<p>to save </p>
<p> <input type="text" data-bind="value: username" /></p>
<br><br>
</label>
<div class="buttonArea">
<input type="submit" id="save" data-role="button" data-bind="click: onSave" class="login-button" value="Save" />
<br><br>
<input type="submit" id="show" data-role="button" data-bind="click: onShow" class="login-button" value="Show" />
</div>
</div>
TestViewModel = kendo.data.ObservableObject.extend({
onShow:function(){
var that=this;
alert(window.localStorage.flag);
},
onSave: function () {
var that = this,
data = that.get("username").trim();
window.localStorage.setItem("flag", data);
},
})
I think this means old cordova versions.
http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html#localStorage
Phonegap use cordova too and there is nothing about this in the doc only for BlackBerry WebWorks (OS 6.0 and higher). So it seems... no problems for you.