V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
zengxiangjun
V2EX  ›  程序员

求教 Refused to set unsafe header "Cookie" 如何解决

  •  
  •   zengxiangjun · May 6, 2018 · 8619 views
    This topic created in 2914 days ago, the information mentioned may be changed or developed.
    1. a.site.com 跨域请求了 b.site.com 的接口(注意是二级域)
    2. 在发起的前端 ajax 请求中已经设置了 crossDomain 为 true, 并且 withCredentials 为 true
    3. b.site.com 的接口正确返回了结果
    4. 但浏览器端依然报错:Refused to set unsafe header "Cookie"

    环境:chrome。向各位大神求解

    kfll
        1
    kfll  
       May 6, 2018 via iPhone
    Ajax 不允许手动指定 Cookie Header,详见 MDN
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   993 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 19:31 · PVG 03:31 · LAX 12:31 · JFK 15:31
    ♥ Do have faith in what you're doing.