亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

混合app中客戶端允許發送 cookie后,服務器跨域必須設置域名怎么辦?

混合app中客戶端允許發送 cookie后,服務器跨域必須設置域名怎么辦?

江戶川亂折騰 2019-03-13 17:15:50
客戶端代碼:let xhr = new XMLHttpRequest();xhr.open('post' , url , true);xhr.withCredentials = true;xhr.send(null);服務端:header('Access-Control-Allow-Origin: *');header('Access-Control-Allow-Credentials: true');客戶端報錯:Access to XMLHttpRequest at 'http://t.com/index.php' from origin 'null' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.請求頭也變成沒有完整信息的請求頭了:請問,混合 app 開發方式下,如何允許客戶端攜帶 cookie ??
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 395 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號