ASP.NET Sessions

One of the challenges to developing a successful Web application is maintaining user information over the course of a visit, or session, as the user moves from page to page in an application.

Essentially, a session is the period of time that a unique user interacts with a Web application.

HTTP is a stateless protocol, in the sense that a Web server is concerned only with the current HTTP request for any given Web page. The server retains no knowledge of previous requests, even if these occurred only prior to the current request.

This inability to remember the state of previous requests presents unique challenges when writing Web applications such as an online shopping cart, that need to track the catalog items a user has selected while moving around the various pages of the catalog.

ASP.NET provides a solution for managing session information via the System.Web.SessionState namespace. This namespace describes a collection of classes used to enable storage of data specific to a single client within a Web application. The session-state data is used to give the client the appearance of a persistent connection with the application.

Using the intrinsic ASP.NET Session object and a special user ID generated by the Web server, developers can create smart applications that can identify each user and collect information that an application can then use to track user preferences or selections.

Posted by:

No comments posted.

Name :  

Email :  

Comment Below