I am trying to intercept cookies. Here is the request timeline:
- I send a
POST
request. - The server sends a
302
and adds in twoSet-Cookie
headers (used for authentication) - jQuery or WinJS adds the headers and sends a GET to the redirect url.
- I get a
200
response, but cookies are not included here.
Can I intercept these cookies anywhere?
Here are the two ways I can send this request:
WinJS.xhr({
type: 'post',
url: url,
data: token
}).done(
function completed(request) {
// get cookie?
}
);
$.ajax({
url: url,
type: 'post',
data: token,
success: function(data, text, xhr) {
// get cookie?
}
});