xmlHttp.getResponseHeader + Not working for CORS

前端 未结 2 1409
孤独总比滥情好
孤独总比滥情好 2020-11-27 06:26

I have an asp.NET WCF on .NET 4. This service is used to authenticate users. We are submitting a username and password and then an HTTP Header should be returned with the au

2条回答
  •  醉酒成梦
    2020-11-27 07:19

    The browser's security policies might block your response because you have not set:

    HttpContext.Current.Response.AddHeader("Access-Control-Allow-Credentials","true");
    

    If that doesn't help, try adding

    xhrFields: { withCredentials: true }
    

    to your ajax options might also be worth a shot.

提交回复
热议问题