Cookies : A look
Cookies
Cookie is a very familiar term in web development environment. Cookie is a client-side storage that is sent to the server for each request and also received as response back from the server. Because of its size limitation (4096 bytes) it should be used for storing small amount of data. Expiration policies can be set for cookies to invalidate the items after a certain period of time.
The following example shows how Cookie can be used in an ASP.NET application:
if (this.Request.Cookies["MY_NAME"] == null)
{
this.Response.Cookies.Add(new HttpCookie("MY_NAME",
"Shubhabrata Mohanty"));
}
else
{
this.Response.Write(this.Request.Cookies["MY_NAME"].Value);
}