关于ajax跨域问题无法获取session

1
2
3
4
5
6
7
$.ajax({
url : 'http://localhost/getData',
// 在ajax请求中添加如下条件即可
xhrFields: {
withCredentials: true
},
})

MDN参考

可以看到该文指出在同一个站点下使用withCredentials属性是无效的

赏个🍗吧
0%