•Web (HTTP) uses a stateless protocol.
•Web forms are created and destroyed each time a client browser makes a request.
•Because of this characteristic, variables declared within a Web form do not retain their value after a page is displayed.
•ASP.NET provides different mechanisms to retain data on a Web form between requests.
•To solve this problem, ASP.NET provides several ways to retain variables' values between requests depending on the nature and scope of the information.
•Hypertext Transfer Protocol (HTTP) is a stateless protocol. Each browser request to a Web server is independent, and the server retains no memory of a browser's past requests.
•The Session object, one of the intrinsic objects supported by ASPX, provides a developer with a complete Web session management solution.
•The Session object supports a dynamic associative array that a script can use to store information. Scalar variables and object references can be stored in the session object.
•For each ASPX page requested by a user, the Session object will preserve the information stored for the user's session. This session information is stored in memory on the server. The user is provided with a unique session ID that ASPX uses to match user requests with the information specific to that user's session.
A session is terminated when you close the browser.•
You can use the Session object to store information needed for a particular user-session.
•Variables stored in the Session object are not discarded when the user jumps between pages in the application; instead, these variables persist for the entire user-session.
•The Web server automatically creates a Session object when a Web page from the application is requested by a user who does not already have a session.
•The server destroys the Session object when the session expires or is abandoned.
•One common use for the Session object is to store user preferences.
The Disadvantages of Using Cookies
•Limited size. Most browsers place a 4096-byte limit on the size of a cookie, although the support for 8192-byte cookie size is becoming common in the new browser and client-device versions available today.
•User-configured refusal. Some users disable their browser or client device's ability to receive cookies, thereby limiting this functionality.
•Security. Cookies are subject to tampering. Users can manipulate cookies on their computer, which can potentially represent a security compromise or cause the application dependent on the cookie to fail.
•Durability. The durability of the cookie on a client computer is subject to cookie expiration processes on the client and user intervention.
•Cookies are often used for personalization, where content is customized for a known user. In most of these cases, identification is the issue rather than authentication, so it is enough to merely store the user name, account name, or a unique user ID (such as a GUID) in a cookie and use it to access the user personalization profile from a database of the site.

No comments:
Post a Comment