OnAppendCookie callback doesn't work
I have an ASP.NET Core project, which uses IdentityServer4. In my configuration I have CookiePolicyOptions which contains the next setup:
For some reason, I can't reach the code from the OnAppendCooie and OnDeleteCookie.
I've also added a custom filter to append a new cookie to the response. The behavior was still the same - OnAppendCookie and OnDeleteCookie were not called.
2 Replies
My filter looks like this
and registration
Am I missing something? I thought it should trigger when every cookie appends
The example application
https://github.com/ihordyrman/CookieTest/blob/main/Program.cs
Alright, I found the reason.
It requires an additional middleware.