Reputation: 27
I'm currently researching .Net through their HTML5 MTA course. My book has this explanation of Session vs Application state:
State management is the process of maintaining Web page information during multiple
requests for the same or different Web page. When a user first requests access to an
application, the session state is created. The state ends when the user closes the session.
This is confusing me because they seem to be saying the same thing.
A requests to an application = session state
A request for a webpage = Application state
Are webpages not applications?
It then describes Persistent state information as:
Persistent state information is data that an application needs after the session ends. Many
Web applications need to store data (make it persistent) so that users can pick up where they
left off when they return to the site.
'data that an application needs after the session ends' - you just told me session states come before application states?
im so confused can someone help explain these 2 concepts for me?
Upvotes: 2
Views: 8151
Reputation: 11
Application State is data that is particular to the application. It is stored in the server, so can be easily accessed and helps in fast retrieval. This is used when you have a variable that needs to be globally accessed and exist for the entire lifetime of the application.
Session State is used to maintain data specific to a user.It is stored in the server or database.This is a single user- global variable.
Upvotes: 1
Reputation: 1614
This is actually not limited to .net.
Upvotes: 5
Reputation: 39329
"Application state" = the state of the application, which is the same for all users.
"Session State" = state specific to this particular user session. Each user has separate session state.
Upvotes: 5