ajax跨域问题解决sessionid不一致问题,在Ajax里面添加上下面红色代码即可:
crossDomain: true,
xhrFields: {
withCredentials: true
},
$.ajax({
url:"http://citygame1234.4kb.cn/CityServer/w/login",
type:"post",
async:"false",
dataType:"json",
crossDomain: true,
xhrFields: {
withCredentials: true
},
success:function(data){
console.log(data);
}
});