Hi
Can anyone Tell me? What is the exact difference between Application Object and Session Object?
Thanks in Advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jiteendra SampathiraoPosted Aug 16, 2011, 12:38 AM
Application Object:
Application variables are the variables which remain common for the whole application…
Their value can be used across the whole application… And they die only when the application stops or probably when they are killed forcibily… The ideal example for these kind of variables are site counter… We can find out how many people accessed a particular site since the time it went live via application variables and incrementing the same on ever session start..
Session Object:
Session variables are variables which remain common for the whole application but for one particular user.
They also can be used across the whole application… But they die when a particular user session ends or probably
when they are killed forcibily… The ideal example for this kindof variable are user id… You might want to show "Welcome Vishal" on every page of your site till vishal logs off… So in session start you set a variable to "something" and kill it on session end… All these methods like session start, session end, application start, application end are found in global.asax and that's the reason global.asax is one for the whole ASP.Net application…
Hope it help you.....