Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.Net MVC OnSessionStart event

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?

like image 269
Trimack Avatar asked Oct 07 '09 11:10

Trimack


1 Answers

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.

like image 62
Palantir Avatar answered Oct 18 '22 02:10

Palantir