Session_End in Global.asax in Asp.net has sender and eventargs parameters. Is there any documentation on what these parameters contain for Session_End?
No. Not as far as I can find.
In fact it can be anything of course, but the source code tells us what is really raised:
HttpApplicationFactory.EndSession(sessionState, this, EventArgs.Empty);
The actual call is done here.
The sender is the session state. The eventargs is set to EventArgs.Empty. (this is used as object here the event is raised on)
After looking at the source of the HttpApplicationFactory class:
It doesn't matter whether the handler method is called Session_End or Session_OnEnd, both are handled the same and raised through HttpApplication.EndSession(..., object eventSource, EventArgs eventArgs), which is called from classes in System.Web.SessionState.
The eventSource will be the class raising the event and the EventArgs will be either EventArgs.Empty or some internal object containing session data.
But all of this is undocumented, so I had to stop digging as you shouldn't rely on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With