XMLHttpRequest(Ajax)无法修改header中的Cookie

在调试接口的时候发现Jquery Ajax怎么修改headers的Cookie都无法生效,于是得到了这个答案

另外还有一些也无法修改,下面是不能修改的项目的数组

var forbiddenRequestHeaders = [
    "accept-charset",
    "accept-encoding",
    "access-control-request-headers",
    "access-control-request-method",
    "connection",
    "content-length",
    "content-transfer-encoding",
    "cookie",
    "cookie2",
    "date",
    "expect",
    "host",
    "keep-alive",
    "origin",
    "referer",
    "te",
    "trailer",
    "transfer-encoding",
    "upgrade",
    "via"   ];
    原文作者:琳千秋
    原文地址: https://segmentfault.com/a/1190000002497440
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞