【发布时间】:2014-04-11 08:27:21
【问题描述】:
我正在向服务器发出 ajax 请求,它返回一个包含我的 user_id 的 cookie。所以我解析它以获取用户 ID。
这在 phonegap 中一直有效到 android 4.3,但在 4.4 中它失败了。 ajax 完成后,我得到除了 set-cookie 之外的所有响应头。
我使用 jquery 1.9x 和 phonegap 3.3
这是请求:- $.ajax({
url:urlValue,
data: {email:email,pw:pass,login:1},
contentType : "application/x-www-form-urlencoded; charset=utf-8",
type : "POST",
crossDomain: true,
dataType: 'json',
cache: false,
xhrFields: { withCredentials: true },
success: function(response,status,xhr) {
// do something
}
error {
// check error
}
complete function (jqXHR, textStatus){
console.log(jqXHR.getAllResponseHeaders());
// here i do not find cookie by header "set-cookie"
}
【问题讨论】:
-
遇到同样的问题,你解决了吗?
标签: android jquery ajax cookies cordova