I have found this thread which describes a very interesting OnSessionStart event, but I am unable to "hook" it up (whatever it means) to my global.asax.cs. I am also unsuccessful while searching the web for it. So could someone please explain to me, if the event really exists in asp.net mvc, where do I get it (inherit or what from where) and where do I put it?
Asked
Active
Viewed 4.4k times
1 Answers
82
It looks like this:
void Session_Start(object sender, EventArgs e) {
// your code here, it will be executed upon session start
}
It does work in Asp.net MVC.
Put it as a method in the class defined in Global.asax.cs, for example just after the RegisterRoutes method.

Fredrik Leijon
- 2,792
- 18
- 20

Palantir
- 23,820
- 10
- 76
- 86
-
4Link is broken. Here is another which gives similar info: http://sandblogaspnet.blogspot.com/2008/03/methods-in-globalasax.html – flipchart Sep 12 '13 at 04:48