Application_Start Vs Session_Start

2.9k views Asked by At

Actually I am new to ASP.NET and I came through these concepts. What is the difference between Application_Start Vs Session_Start?

And also how to know how many users are currently active in our application? Is by using Application_Start or by using Session_Start?

2

There are 2 answers

0
Sea Charp On

Application_Start executes just once when the application/worker process starts or IIS restarts. You can instantiate application variables, for example.

Session_start executes each time a Session is created, such as to instantiate and manage visitor data.

0
Devanshu Joshi On

Application_Start Method is Fired on When the Application Started Application_Start runs once before Files are Processed

Where

Session_Start Method is Fired at the beginning of each session. Session_Start runs at the starts of each unique user session.