nginx 添加头部跨域。
location / { add_header ‘Access-Control-Allow-Origin‘ ‘*‘; //允许的域 add_header ‘Access-Control-Allow-Credentials‘ ‘true‘; //允许cookie }
前端ajax session id 不一致问题:
$.ajax({ url:url, xhrFields: { withCredentials: true }, crossDomain: true, success:function(result){ alert(“test”); }, error:function(){ } });