【PHP】js跨域 SESSION问题
场景:
在域名 m.lanse93.dev ajax请求 pt.lanse93.dev 下面的has_message接口,接口中需要获取用户的登录SESSION。
解决方案:
xhrFields: { withCredentials: true }, crossDomain: true,
详细参考:jQuery ajax中的参数含义
得意时做事,失意时读书
场景:
在域名 m.lanse93.dev ajax请求 pt.lanse93.dev 下面的has_message接口,接口中需要获取用户的登录SESSION。
解决方案:
xhrFields: { withCredentials: true }, crossDomain: true,
详细参考:jQuery ajax中的参数含义