Make it very clear that HttpClient stores cookies by default
Issue description
The MSDN page documenting HttpClient does not include any annotation regarding the fact that the internal HttpClientHandler stores cookies by default.
To reach that information you'd need to dig deeper to learn that UseCookies is set to true by default.
This also seems to be the case for the HttpClients created with HttpClientFactory, since they reuse the HttpClientHandlers and calling this in an endpoint causes the internal cookie container to grow across calls.
var h = fac.CreateClient();
await h.GetAsync("page-url");
Not making this default functionality blantly clear on the HttpClient page could expose consumers of HttpClient to huge security risks in scenarios involving any sort of cookie authentication and multiple users of the app, hence a warning box on the page seems sensible.
Target framework
- [x] .NET Core
- [x] .NET Framework
- [x] .NET Standard
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: cbd5007c-82e5-a0c1-2156-7df4bbbcc2da
- Version Independent ID: eba98e03-3cc2-bebe-3dcd-45eda9c9c378
- Content: HttpClient Class (System.Net.Http)
- Content Source: xml/System.Net.Http/HttpClient.xml
- Product: dotnet-api
- Technology: system.net
- GitHub Login: @karelz
- Microsoft Alias: ncldev