In Asp.Net, is there any life cycle event from where I can modify the Response Cookies ?
I want a common place where I can set the SameSite flag on all cookies added by any code. I also need an access to HttpContext.Current.Session in that event.
I already tried PreSendRequestHeaders, PostReleaseRequestState, PostAcquireRequestState and EndRequest but none of them worked.
It cannot be achieved in one event.
So I used PreSendRequestHeaders to change the response.cookies.
It doesn't have access to Session object, but I added required session variables in Request.Cookies in Session_Start event.
Note: Adding something in Request.Cookies doesn't make any change in response cookies.