How to Generate Cookies in ASP.NET?

Cookies in ASP.NET:

Cookies are small pieces of text, stored on the client’s computer to be used only by the website setting the cookies. There are two types of cookies in ASP.NET:

1. Persistence Cookie: This type of cookie is permanently stored on the user’s hard drive. These types of cookies which have an expiry date time are called persistence cookies.

2. Non-Persistence Cookie: These types of cookies are not permanently stored on the user’s hard drive. When the user closes the browser the cookies will be automatically deleted.