jQuery 跨域请求中,需要设置哪个属性为 true,才能携带 cookie 信息?
解析:跨域请求要想带上 cookie,必须将 withCredential
属性设置为 true。
$.ajax({
type: 'post',
url: '',
xhrFields: {
withCredentials: true
}
})
解析:跨域请求要想带上 cookie,必须将 withCredential
属性设置为 true。
$.ajax({
type: 'post',
url: '',
xhrFields: {
withCredentials: true
}
})