Hi
What are the Application and Session objects in ASP.NET ?
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.
Anil KumarPosted May 30, 2012, 5:10 AM
Session is a ready to use object. When user interacts with your application page, an unique id is maintained for a time fame. This time-frame for auto expiry can be defined by you using Session.Timeout. You declare your sessions in Global.asax file OR you can directly add/use at your page. I prefer to put in Global.asax file, so that at any time you can find how many session variables your application is using.
To add a session @code-behind page:
Session["mySessionName"] = "Session-Value";
You can access the value/use this session variable on any page.
Application variables are same like Sessions but they are accessible at application level. Means they are common to all users. So when you require some global level information for your application, you use Application variables.
Both are ready to use (built-in) objects and we use them directly without creating instance(object of them).
Using Session and Application Objects in ASP .NET
Satyapriya NayakPosted May 29, 2012, 12:13 PM
Please refer the below link
http://www.c-sharpcorner.com/UploadFile/051e29/session-and-application-in-Asp-Net/
Thanks