详细问题描述
iOS端设置cookie后,在多任务管理里退出,再重新进入应用,此时cookie已丢失
重现步骤
[步骤]
[结果]
[期望]
运行环境
iOS10.2
[IDE版本] 8.0.0.201702142318
附件
[代码片段]
var host = "http://www.baidu.com/",
name = "test_name",
value = "test_value",
output = document.getElementById("output");
window.addEventListener("load", function() {
document.getElementById("btn_set").addEventListener("click", function(e) {
var exp = new Date();
var time = 15 * 24 * 60 * 60 * 1000;
exp.setTime(exp.getTime() + time);
plus.navigator.setCookie(host, name + "=" + value + "; expires=" + exp + "; path=/");
output.value = "设置成功";
});
document.getElementById("btn_get").addEventListener("click", function(e) {
output.value = "获取完成:\n" + plus.navigator.getCookie(host, name);
});
document.getElementById("btn_remote").addEventListener("click", function(e) {
plus.navigator.removeAllCookie();
output.value = "移除完成";
});
})
联系方式
[QQ] 576696294
[电话] 15999948166