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);
},
})