I am sending a http request and a cookie is send back. I can see the cookie name and it’s value in Reources/Cookies/127.0.0.1/
Here is the problem: When I try to get the cookie on the web console by using document.cookie , there is no cookie and the result is empty ""
Here is my http request by the use of Ext js.
new Ext.Application({
launch : function() {
Ext.util.JSONP.request({
url : 'host',
params : {
method : 'GET',
username : 'userName',
password : 'password',
press : 'Login'
}
});
}
});
I noticed that I can get the cookie on concole by document.cookie when I normally log-in on the website, but when I send the http request by this code, I can not get it on concole.
I appreciate if you provide me the solution of the problem as well as some explanation why/when this happens ?
Does your script execute at the domain you are setting cookie for? Executing document.cookie in console returns cookie for the domain it is executed at.
If you are sending a request for the qalixa.com domain, the cookie is set for that domain, not 127.0.0.1.
If you are debugging a site at your localhost, you should send a request to “https://127.0.0.1/ce/dynamic/ce/auth.html” then.