Ionic 2 Angular2 http post set cookie

Does anyone know if it is possible to save cookies after logging in to http after logging in to angular 2? When I check the headers in response, I see that there are cookies, but they will not be saved in the browser, and I will not be able to access them.

enter image description here

I also tried accessing the 'set-cookie' directly, but did not work.

this.http.post(this.serverUrl+"/login/", {data: {email: email, pass: pass}}) .subscribe(res => { let headers: Headers = res.headers; let cook = headers.getAll('Set-Cookie')); //this is null 

I will be very happy for any help I don’t know about how to do this and save cookies. Thanks.

+5
source share

Source: https://habr.com/ru/post/1260475/


All Articles