Question - Define Session, SessionId and Session State in ASP.NET.
Answer - A session is the duration of
connectivity between a client and a server application.
SessionId is used to identify request from the browser. By default, value of
SessionId is stored in a cookie. You can configure the application to
store SessionId in the URL for a "cookieless" session.
Question - What is Session Identifier?
Answer - Session Identifier is used to
identify session. It has SessionID property. 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.
Question - Advantages and disadvantages of using Session
State.
Answer - The advantages of using
session state are as follows:
It is easy to implement.
It ensures data durability, since session state retains data even if ASP.NET
work process restarts as data in Session State is stored in other process
space.
It works in the multi-process configuration, thus ensures platform scalability.
The disadvantages of using session state are:
Since data in session state is stored in server memory, it is not advisable to
use session state when working with large sum of data. Session state variable
stays in memory until you destroy it, so too many variables in the memory
effect performance.
Question - What are the Session State Modes? Define
each Session State mode supported by ASP.NET.
Answer - ASP.NET supports three Session State
modes.
-
InProc
-
State Server
-
SQL Server
InProc Mode
This mode stores the session data in the ASP.NET worker process.
This is the fastest among all of the storage modes.
This mode effects performance if the amount of data to be stored is large.
If ASP.NET worker process recycles or application domain restarts, the session
state will be lost.
State Server mode
In this mode, the session state is serialized and stored in memory in a
separate process.
State Server can be maintained on a different system.
State Server mode involves overhead since it requires serialization and
de-serialization of objects.
State Server mode is slower than InProc mode as this stores data in an external
process.
SQL Server Mode
In this storage mode, the Session data is serialized and stored in a
database table in the SQL Server database.
This is reliable and secures storage of a session state.
This mode can be used in the web farms.
It involves overhead in serialization and de-serialization of the objects.
SQL Server is more secure than the InProc or the State server mode.
Define .Net Assembly. | What does an assembly contain? |
Define a private assembly and a shared assembly. | What are Satellite
Assemblies? | What do you understand by side-by-site execution of assembly? |
How do you create a resource-only assembly? | Explain how to retrieve resources
using ResourceManager class. | Define Strong Name. | How do you apply a strong
name to assembly? | Define Global Assembly Cache. | How do you install assembly
to the Global Assembly Cache?
Define Authentication and Authorization | What is the
authentication mode available in ASP.NET? | How do you set authentication mode
in the ASP.NET application? | List out the difference between windows
authentication and form authentication | How do you impersonate the
authenticated user in ASP.NET? | How do you provide secured communication in
ASP.NET?
|