Athough you added parameter: {withCredentials: true} in your request, the browser still not included cookies to send your request because: If you still run your project without SSL, the browser still not include cookies when sending HTTP request. To add SSL into your localhost, let try using mkcert, by follow: enter link description here
First, we need install certificate authorities (CAs) corresponding with you machine. Incase , you use window, let try: enter link description here
follow mkcert instruction
add SSL to your front-end project
Config Angular.json file to use SSL Config 'option' inside the 'serve' like that:
"options": { "ssl": true, "sslCert": "ssl/localhost.pem", "sslKey": "ssl/localhost-key.pem" },
Finally, you run your app, it will run localhost with SSL: https://localhost:4200/