| Author : Manoranjan Sahoo|| Member Level : Bronze||Date : 27/04/2012 08:12:39 PM|| Points : 4|
Yes, Both application and session are server side state management. You can choose session and application state management as per our requirement. If you want to access the same state variable in all session then you must save that value in application state variable because this is the global object. But session is not global object, it creates new session every time a new user enters into the application.
Ex : Session : suppose you want to store some specific user information for some time till the user access the page and no other user can access that value then you have to save those value in session variable.
Application : suppose you want to show the number of user currently access to the site to all the user then you need to set some counter and need to save that in some variable.
It means you have to access that variable by all user. At this time you need to store the variable in application state varible as this is store in global object.
Hope this will help you.
| Author : Gopesh Sharma|| Member Level : Bronze||Date : 09/10/2012 11:52:55 AM|| Points : 2|
Application Variable: Application state variables are global variables for each ASP.NET application, and this variables can be used anywhere in your application.
Session Variable: You can store values to this variable where you want to store data of a particular session, like whenever a user logs in, and this session data will be removed, whenever the user logs out.