跨域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');//必须为true,和withCredentials:true配置对应
posted on 2019-03-26 18:00 darkness_1 阅读(105) 评论(0) 收藏 举报
浙公网安备 33010602011771号