SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a SharePoint equivalent of the Session_End method, like the one in a normal ASP.NET Web Application Project?

I want to run some code when a user's Session ends, just like you would in a normal ASP.NET Web Application. The code takes data collected during the Session and stores it away.

I've read an article that describes how to enable Session State in SharePoint 2010 Server, but I'm not sure what this actually means in my case.

I've also read an article about adding a HTTP Module that inspects Sessions an acts upon them, but I'm not sure how this would work in SharePoint.

share|improve this question
is the information critical to your application, do you still receive those events if the app pool dies/server restarts? – djeeg Apr 14 '11 at 3:18
@djeeg Not critical. It's the same type of information I'd want from Session_End. – ScarePoint Apr 14 '11 at 7:17

A similar post already answered this:

SharePoint equivalent of Application Start in Global.asax

SharePoint implements its own compiled assembly to handle events in the Global.asax and the class is sealed so you can't inherit it and override. You need to write a custom HTTP module to tap into the ASP.NET pipeline.

share|improve this answer
Do you mean something like this?… Are you sure this will work with SharePoint? Sessions seem a bit quirky in SharePoint. – ScarePoint Apr 14 '11 at 7:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.