I am trying to get the set-cookie from Response Headers.
The reason of doing this is set-cookie is not setting cookie and showing the warning This attempt to set a cookie via a Set-Cookie header was blocked because its Domain attribute was invalid with regards to the current host url. Attached is the screenshot
Now I thought to get the set-cookie value from Response Header by the following code

But it always returns null for set-cookie but return the value fo expires.
Please anyone can guide how to fix this issue or how can I get the value of set-cookie from Response Header.
Any help will be highly appreciated.
Thanks
According to developer.mozilla.org set-cookie is a forbidden response header name. You cannot read it using browser-side JavaScript
Browsers block frontend JavaScript code from accessing the Set Cookie header, as required by the Fetch spec, which defines Set-Cookie as a forbidden response-header name that must be filtered out from any response exposed to frontend code.