I'm working on Ionic 3 and I need to get the response of the cookies from the headers. look at that:
Set-Cookie:.AspNet.TwoFactorCookie=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
Set-Cookie:.AspNet.ExternalCookie=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
Set-Cookie:.AspNet.ApplicationCookie=-mi7oCB299B3rTFplCLZoY-M46grmtB5G6QY90Z8636uUTIQVWhZzmyTKZRzt2fTPGqHqrV409f5SiDa44qsuZPCqqp5rOAshKx6WBi-p2oDQx9CqFphRez9wfrFtwYHAaNZrSv3EtlzmUKgsAx6WzZ-bbADmc1MKrWoK9iWN_oOlR-LoJQURSzF1zk29P5puMQb_osco5FSA9NBSbsiEfqWT-FaY5sDclgiBVPrDu6aw5KOtrKh50pEKH5coneroHW_Qnv_Eizso8F2sTmgK0wuC4Feq-iu5kmkA-3f59j59KwbFir6bHt2rJYLrA-kXR3U28AXd9TszN_K39p_WgyNywYl8UyC_OA56Wu5rVAfiUmN76CyAE_MqGZit1Kap43Db1IzCv-Hif8AgTbyVxni8tcaucvaXXwssrvv2YnEhSZRupywRMu7539W-MK5e5pDKRM2ImZLsFnDMOpbJDeCSkNPFsfqAyybgbSp79lX4OVh98yiN-xkRMkbp_IRBiD1UFpTJF81seD1fcn_Sg; path=/; expires=Sun, 11-Mar-2018 05:16:12 GMT; secure; HttpOnly
Set-Cookie:ARRAffinity=1c9f49441daef96a3a5b64bf3c3bd25480d9a2c738819ed568ce423efddd7076;Path=/;HttpOnly;Domain=tarjetadsalud-mobile.azurewebsites.net
Those are the response headers when logging in, I need to get the cookie to send the session token in each request Here my code
return new Promise((resolve, reject) => {
that.http.post('htttp://xxxxxxxxxxxxxx',
JSON.stringify(params), {
headers: new HttpHeaders().set('Content-Type', 'application/json')
}
)
.subscribe(res => {
console.log(JSON.stringify(resolve(res)));
if(res['Resultado'] == true){
localStorage.setItem('Username',res['Nombre']);
navi.setRoot("HomePage");
}else{
that.toastCtrl.presentToast('Usuario o Contraseña incorrecta');
}
}, (err) => {
alert('Error de usuario o contraseña')
reject(err);
});
});
in advance thanks