Hi
What are the Application and Session objects in ASP.NET ?
Application Object and Session Object
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted May 29, 2012, 8:13 AM EDT
Please refer the below link
http://www.c-sharpcorner.com/UploadFile/051e29/session-and-application-in-Asp-Net/
Thanks
Anil KumarRank #367 · 6.8K reputationPosted May 30, 2012, 1:10 AM EDT
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