Though the SessionStateModule.End event is public, you can only handle it by adding an event handler in the Global.asax file. This restriction is implemented because System.Web.HttpApplication instances are reused for performance. When a session expires, only the Session_OnEnd event specified in the Global.asax file is executed, to prevent code from calling an SessionStateModule.End event handler associated with an System.Web.HttpApplication instance that is currently in use.