State management interview questions part 2
11. What is Query string?
A query string is information that is appended to the
end of a page URL.
12. What is application state?
Application state is a global storage mechanism that
is accessible from all pages in the Web application. Thus, application state is
useful for storing information that needs to be maintained between server round
trips and between requests for pages.
13. What is Session state?
ASP.NET allows you to save values by using session
state — which is an instance of the HttpSessionState class — for each active
14. What is Profile Properties?
ASP.NET provides a feature called profile properties,
which allows you to store user-specific data. This feature is similar to
session state, except that the profile data is not lost when a user's session
expires. The profile-properties feature uses an ASP.NET profile, which is
stored in a persistent format and associated with an individual user.
15. What is Session?
As we know, HTTP is a stateless protocol; it can't
hold client information on a page. Session provides a facility to store
information on server memory. It can support any type of object to store along
with our own custom objects. For every client, session data is stored
separately, which means session data is stored on a per client basis.
16. What are Advantages and disadvantages of
1. It helps maintain user state and data all over the
2. It is easy to implement and we can store any kind of
3. Stores client data separately.
4. Session is secure and transparent from the user.
1. Performance overhead in case of large volumes of
data/user, because session data is stored in server memory.
2. Overhead involved in serializing and de-serializing
session data, because in the case of StateServer and SQLServer session modes,
we need to serialize the objects before storing them.
17. Explain in detail Session state
state supports three modes:
2. State Server
3. SQL Server
1. This mode
stores the session data in the ASP.NET worker process.
2. This is the
fastest among all of the storage modes.
3. This mode
effects performance if the amount of data to be stored is large.
4. If ASP.NET
worker process recycles or application domain restarts, the session state will
State Server mode
1. In this
mode, the session state is serialized and stored in memory in a separate
2. State Server
can be maintained on a different system.
3. State Server
mode involves overhead since it requires serialization and de-serialization of
4. State Server
mode is slower than InProc mode as this stores data in an external process.
SQL Server Mode
storage mode, the Session data is serialized and stored in a database table in
the SQL Server database.
1. This is
reliable and secures storage of a session state.
2. This mode
can be used in the web farms.
3. It involves
overhead in serialization and de-serialization of the objects.
4. SQL Server
is more secure than the InProc or the State server mode.
18. What is Session Identifier?
Identifier is used to identify session; it uses SessionID property to identify
When a page
is requested, browser sends a cookie with a session identifier. This identifier
is used by the web server to determine if it belongs to an existing session. If
not, a Session ID (120 - bit string) is generated by the web server and sent
along with the response.
What do you understand by StateServer(Out-Proc) mode?
session mode is also called Out-Proc session mode.
uses a stand-alone Windows Service which is independent of IIS and can also be
run on a separate server. This session state is totally managed by
3. This server
may run on the same system, but it's outside of the main application domain
where your web application is running. This means if you restart your ASP.NET
process, your session data will still be alive
Under StateServer(Out-Proc) mode the session state is managed by?>