2013-06-30 6 views
0

asp.net xss 스크립팅을 사용합니다. 한 페이지는 쿠키를받은 것보다 게시물을 전송합니다. 헤더에서 쿠키가 반환되지만 브라우저가 쿠키를 설정하지 않습니다.쿠키가 설정되지 않았습니다.

Set-Cookie:token=12ccc584-9f14-4c07-bbd9-0deba07b2a8e; expires=Fri, 30-Aug-2013 16:33:53 GMT; path=/ 

내가 백엔드에서 이러한 헤더를 허용 : 왜 쿠키가

HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", 

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



$.ajax(
      { 
       url: "http://localhost:49670/api/authentication", 
       type:"post", 
       data: loginDTO, 
       success: function() { 
        console.log("works"); 
      console.log("cookies: ", document.cookie); 
      }, 
      error: function(request, status, error){ 
       console.error(request.responseText); 
       }, 
       xhrFields: { 
        withCredentials: true 
       } 
      }); 

을 잘 살고되지 않았습니다 그래서 document.cookie를가

헤더 널?

답변

0

localhost가 아닌 "localost"를 작성했기 때문에?

+0

아니요, http : // localhost를 썼습니다. 여기서 실수를했습니다. – user1693057

관련 문제