Cookies in C#

Cookies in C#

This article provides an overview of working with
cookies in ASP.NET applications. I will show you the mechanics of working with
cookies in ASP.NET.
Along the way, I will explain various features and (occasional) oddities of
cookies and the support in ASP.NET for them.

Cookies provide a useful means in Web applications to
store user-specific information. For example, when a user visits our site, we
can use cookies to store user preferences or other information. When the user
visits your Web site another time, the application can retrieve the information
it stored earlier.

A cookie is a small bit of text that accompanies
requests and pages as they go between the Web server and browser. The cookie contains
information the Web application can read whenever the user visits the site.

Imagine that when users request a page from your
site, www.mindstick.com, your application sends not just a page, but a cookie
containing the date and time. When the user's browser gets the page, the
browser also gets the cookie, which it stores in a folder on the user's hard
disk.