“AddCookie” service is used to add a cookie to store any value. Cookies are small files which are stored on the user’s computer for a certain number of days. We have the ability to determine how long they are stored before they expire when creating them. The users have the ability to view the cookies stored on their computer for the various sites they visit and view the data, so it is important to encrypt the values you save to cookies.
Cookies have a name, which is used to identify them, and a value. The name must be unique for the site. If it is not unique, using the AddCookie service will just override the existing cookie of the same name.
Cookies can be useful when you want to save a variable and not have it wiped when the user’s Internet Information Services (IIS) session ends on the session timeout or when closing the browser, like with Session Variables.