Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe how ASP.NET maintains process isolation for each Web application?

1073


What are asp.net web forms?

1003


What is difference between Server.Transfer and Response.Redirect in ASP.NET?

1076


Is asp.net a programming language?

1002


Explain a program using code nuggets to create a simple application? : asp.net mvc

1051


What is session authentication?

986


What will happen if the server confugration file and the application confugration file have different values for sassion state ASP.NET?

1224


What is the difference between c# and .net?

1038


List the types of authentication supported by asp.net?

937


What are themes and skins in 2.0, explain usage scenario?

937


What are the types of validation in asp net?

1025


Describe the application event handlers in ASP.NET?

1041


Can we have multiple web config files for an asp.net application?

975


Is asp.net and .net same?

970


What are the contents of cookie?

1101