How do you handle session management in ASP.NET and How do
you implement them. How do you handle in case of SQLServer mode?



How do you handle session management in ASP.NET and How do you implement them. How do you handle in..

Answer / venugopal

ASP.NET session state enables you to store and retrieve
values for a user as the user navigates ASP.NET pages in a
Web application. HTTP is a stateless protocol. This means
that a Web server treats each HTTP request for a page as an
independent request. The server retains no knowledge of
variable values that were used during previous requests.
ASP.NET session state identifies requests from the same
browser during a limited time window as a session, and
provides a way to persist variable values for the duration
of that session. By default, ASP.NET session state is
enabled for all ASP.NET applications.

We can create the session in Asp.Net is as fallows..

Session["FirstName"] = "venugopal";

In case of Sqlserver session stage we will use the
web.config

In web.config we wills store the session like as fallows

<sessionState
mode="SQLServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user
id=username;password=password"
cookieless="false"
timeout="20" />

Remember that the element names and attributes are case-
sensitive.

This is the most reliable since it's disconnected from the
Web server. This option uses the sqlConnectionString
option. The connection string follows the normal syntax for
connecting to a SQL Server database.

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

About CLR, reflection and assemblies?

0 Answers   Microsoft,


Define static constructor?

0 Answers  


What is a viewstate?

0 Answers  


Features of a dataset ?

3 Answers   Accenture,


What is the use of dispose method?

0 Answers  






When a dropdownlist has been added by some records and it has been binded why it is not executing i'm facing this error pls help me ? if (is!pageposback) { arraylist books = new arraylist; books.add ("gone with the wind"); books.add ("rahulsriramprakash"); books.add ("vishal"); dropdowndisplay.datasource=books; dropdowndisplay.databind(); } The error is : 1) The dropdowndisplay does not exist.

5 Answers   Netsweeper,


About Garbage Collector?

3 Answers   Microsoft,


Which is better php or asp.net?

0 Answers  


Tell me Asp.net Method Overriding.

3 Answers  


When should I use server transfer and response redirect?

0 Answers  


Can we override the enablepartialrendering property of the scriptmanager class?

0 Answers  


When is an object collected by the Garbage Collector? [Four options were given]

1 Answers   ABC,


Categories