Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are the cookies are being sent with every request but not visible in browser console or with document.cookie?

I have a very strange problem, I am using an express server to set cookies in my Angular 7 project in the browser and later API calls are supposed to send cookies with them. The response header shows that the cookie is being set and request headers of later API calls show that the cookies are being sent. But the problem is the cookies are not visible in the Browser Developer console or as the output of document.cookie. Below attached is the screenshot of response header for setting cookies:

enter image description here

Below is the request header attached while making further API calls:

enter image description here

This question does not resolve the issue as HttpOnly cookie is only 1 out of 3 and even the HttpOnly cookies should be displayed on the browser developer console.

like image 231
Deependra singh Avatar asked Oct 23 '25 17:10

Deependra singh


1 Answers

The cookie's domain should match the domain of the UI app to be seen in developer tools. If the cookie is dropped in api.domain.com and app is in ui.domain.com then via developer tools you can only see cookies in ui.domain.com. You can try explicitly setting the cookie domain to domain.com to see them in dev tools

like image 56
Ramesh Avatar answered Oct 26 '25 07:10

Ramesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!