core icon indicating copy to clipboard operation
core copied to clipboard

Caching headers being overridden by CookieAuthenticationHandler

Open leealexander opened this issue 7 years ago • 1 comments

Issue Title

Caching headers being overridden by CookieAuthenticationHandler

General

The CookieAuthenticationHandler in .netcore 2.2 overrides cache headers previously set by ResponseCacheAttribute.

Moving the "app.UseResponseCaching();" in the config before or after the adding of the " app.UseAuthentication();" makes no difference as the CookieAuthenticationHandler hooks into Context.Response.OnStarting.

Basically my scenario I have no-store and no-cache set and CookieAuthenticationHandler blows away the no-store portion. In the case of a challenged authentication it allows the user to click back from a login screen.

Is this correct behaviour? Shouldn't the ApplyHeaders code in the CookieAuthenticationHandler honour the no-store header if it already exists?

Regards Lee

leealexander avatar Oct 07 '19 08:10 leealexander

This issue was moved to aspnet/AspNetCore#14795

scalablecory avatar Oct 07 '19 17:10 scalablecory