客戶端代碼: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 ??
混合app中客戶端允許發送 cookie后,服務器跨域必須設置域名怎么辦?
江戶川亂折騰
2019-03-13 17:15:50