The Sever side state management technique provides better security and reduces bandwidth. Basically this option is for storing page information that tends to have security than client side options, but they can use more web server resources which may lead to scalability issues when the size of the information is large.
ASP.Net provides several options to implement Server Side State Management are explained below.
Application State: This State information is available to all pages, regardless of which user requests a page. The Application State variables are the global variables for an ASP.NET application. The ASP.NET provides application state via the HttpApplicationState class. You can also store your application specific values in application state, which is managed by the server.
Session State: The Session State information is available to all pages opened by a user during a single visit. This method stores the session specific information (that is values and objects in session state) which is managed by the server and that is visible only within the session. This session state is available as the HttpSessionState class. The Session State which identifies the requests from the same browser during a limited time and it provides the ability to persist variable values for the duration of that session.
Profile properties: It allows you to store user specific data. Unlike session state, the profile data is not lost when a user's session expires. This allows you to manage the user information without requiring, creating and maintaining your own database. It can be used in both multi-computer and multi-process configurations. This property provides a generic storage system that allows you to define and maintain any kind of data while making the data available in a type-safe manner.
Database support: It is also used for database support to maintain the state on your web site. This is used basically with the help of cookies or session state. The Database Support to maintain state information by using a relational database for different reasons like security, personalization, consistency, and data mining.
Asked In: Many Interviews |