Monday, 16 May 2011

Filled Under: ,

Explain cookies

  1. Cookies is a small text file sent by web server and saved by web browser on client machine.
  2. Common use of cookies is to remember last logged in time of a visitor.
  3. Usually cookies are not used to store sensitive information's like passwords without prior encryption as they are just a plain text.
  4. Cookie size is limited to 4096 bytes. So cookies are used to store small amounts of data, often just user id.
  5. Also, number of cookies is limited to 20 per website. If you make new cookie when you already have 20 cookies, browser will delete oldest one.

To check if a browser accepts cookies, use below code in C# :

if (Request.Browser.Cookies)
{
     // Cookies supported
}
else
{
     // Web browser not supports cookies
}



Ref : here

0 comments:

Post a Comment