0

I suppose the Angular application works as follows 1) browser sends a request 2) The server sends response and Angular's JS bundle (main.js).

Assuming that I have understood the working mechanism correctly, is there a way I can get the cookies which are in the http response which delivered the Angular JS bundle?

My server on receiving the request, inserts two cookies and then send a response to the client. The response also includes my Angular application. Is there a way I can get access to the Cookies in my app.component.ts?

Manu Chadha
  • 15,555
  • 19
  • 91
  • 184

1 Answers1

0

I had the same issue with Angular 8, after a lot of research, I've found that Cookies are saved on the browser automatically, if you want to retreive them you can use ngx-cookie-service and get them like if you get an item from your localstorage.

BELLIL
  • 739
  • 10
  • 23
  • thanks. I have a similar opinion. My finding are in this another similar question I created - https://stackoverflow.com/questions/58950016/how-to-make-angular-application-read-cookies-at-start-up – Manu Chadha Nov 26 '19 at 09:12