I have set up a .net core webapi project to allow cross-origin requests by adding the necessary configurations in ConfigureServices and Configure methods. However, when trying to send a fetch request from the browser to the API, the cookies are not being sent along with the request. I have explored various solutions including disabling third-party cookies, but none seem to work.
The values controller in the project has a GET method that should return the cookies associated with the request. Despite setting up CORS and allowing credentials, the cookies are still not being passed to the API endpoint.
After extensive troubleshooting, it was discovered that even cookies from sub-a.domain.com were not transferred to sub-b.domain.com. As a workaround, we created a cookie bound to domain.com, which is successfully transmitted to both sub-a.domain.com and sub-b.domain.com. This solution effectively deals with the issue of sending cookies across different sub-domains within the same domain.