Wednesday, September 5, 2012

Cookies in asp.net

 Cookies are small text files written to the client's computer by a particular web site. These text files can then be read by scripts on the same web server that wrote those cookies. Since the cookies are written on the client's computer, specific information can be saved for each user. By storing information on the client's computer, the web server doesn't have to save this information.

Cookies are nice because they can be used to store small bits of user-specific information. For example, imagine that you wanted to allow your visitors to create a series of their favorite links on the start page of your site . You could create a Form into which the user could enter a series of URLs. You could then store these URLs on the user's computer using a cookie. Whenever a user visited your start page, you would check to see if the cookie that contained their favorite URLs existed- if it did, you would create HREF tags containing their favorite links.

No comments: