接口代码:
function test(){
print (session_id());
}
ci框架,获取sessionID,跨域后,每次访问,session不一致
php头部:
header('Access-Control-Allow-Origin: http://localhost:9000');//主要就是这句!!!不加就可以了,但是无法跨域
header("Access-Control-Allow-Credentials","true");
header("Access-Control-Allow-Origin", "Origin");
Smart猫小萌