Hi I am developing web application in angularjs. On successful login i am returning some cookies. I am trying to read cookies in success function but always i ends with undefined.
$http.post(url, sub).then(function (response) {
//trying to read CookieHeaders=Logintoken=63d4551a-2c09-4b08-9b4b-837f0f3806fd&LoginId=2
setTimeout(function () { LoginSuccess(response); }, 1000);
}, function (error) {
setTimeout(function () { HideLoader(); }, 1000);
toastr.error($filter('translate')(error.data.msg));
});
I tried to get inside the success function as console.log($cookieStore.get('CookieHeaders'));
It gives me undefined.
May i know is it possible to read the above cookie inside success function? Any help in this regard greatly appreciated. thank you.