|Objective||Read user data written during a prior visit. |
HTTP is known as a "stateless" protocol.
Although you cannot store much information in any one cookie, they are still useful for:
After a browser and server have completed an HTTP transaction,
no information (such as data submitted through an HTML Form) is retained. This loss of user information occurs when the user moves from page to page
in a Web site and when a user leaves one Web site for another.
- Identifying returning users: Many sites store a unique user ID in a cookie and then use the cookie value to retrieve user information from a database.
- ASP's Session object: The ASP Session object uses a session cookie (different from a browser cookie) to retain user information as the user goes to various parts of the Web site.
Reading a T-shirt cookie
<TD><%= Request.Cookies("ShirtSize") %></TD>
And here is what is displayed on the user's browser:
Preferred size: XXL
A key specifies a particular element within a collection. For example a collection of first names might use a last name as a key, and Bill Smith's first name could be retrieved with: FirstNames("Smith").