How many types of Cookies in ASP.NET?

Cookies are small pieces of information stored in the client computer . It contains information the Web application can read whenever the user visits the site. They are limited to 4K in size.

There are two type of cookies in Asp.Net:

  1. Persistent cookies
  2. Non-persistent cookies
1) Persistent cookies: These cookies are stored on your computer hard disk. They stay on your hard disk and can be accessed by web servers until they are deleted or have expired. It is saved as a text file in the file system of the client computer usually under Temporary Internet Files folder . 2) Non-persistent cookies: Non-persistent cookies also called as Session cookies or In-memory cookies are saved only while your web browser is running. They can be used by a web server only until you close your browser . They are not saved on your disk.