In ASP.Net Core application, how can I set a cookie and throw an exception during the same request?
In a Web API call, whenever I set a cookie using Response.Cookies.Append()
the cookie header is only sent to the browser when returning from the call without throwing any exception.
If I append the cookie and then throw an exception, the cookie header is lost.
What gives? Am I missing something fundamental here? This doesn't seem like expected behavior.