As you learned yesterday, cookies can be written to the client's computer using the Response. Cookies collection and can be read using the Request. Cookies can persist on the client's computer for a variable amount of time. When writing a cookie to the client's computer, you can set when the cookie expires. This can be in a day, a week, or even a year.
Cookies allow a user's state to be maintained beyond the current visit.
Let's examine how you can use cookies to maintain this information. Listing 11.1 created a simple form in which the user was prompted to enter his or her name. This form, when submitted, passed the user's name through the querystring to Welcome.asp, the form processing script. Because you are going to use cookies to maintain state in this example, you don't need to worry about having all the hyperlinks in Welcome.asp passing along the querystring information. All you need to do in Welcome.asp is write the name of the user to a cookie.