Reputation: 7802
I am trying to make a cross-site request, on a site that needs authentication. The authentication works with a cookie.
For some reason, when I am doing this call :
$.getJSON(url + '?', function(data){
alert(data);
});
I don't see the Cookie
sent in the HTTP headers. While when I just copy paste url
in my address bar, the call is successful, and Cookie
is set properly...
I tried to replace the $.getJSON
by a $.ajax
, and set manually the request headers. It resulted in the request not even visible in firebug (while I know it has been sent and answered to by using another tool)!!!
I am using firefox 3.6, jquery 1.4
Any idea on what's going on ?
Upvotes: 0
Views: 457
Reputation: 630359
This is part of the same origin policy, JSONP requests to other domains will not have any cookies sent with them.
Upvotes: 1