跨域cookie使用

$.ajaxSetup({
            xhrFields:{
                withCredentials:true,
            }
        });
header("Access-Control-Allow-Origin:http://localhost:9999");//使用cookie时此处不可用通配符
header("Access-Control-Allow-Headers:X-Request-With,Content-Type");
header('Access-Control-Allow-Credentials:true');

  

猜你喜欢

转载自www.cnblogs.com/flytome/p/10601820.html