Cookies are data that's generated and stored by websites on your system or computer. Data in cookies helps identify web requests from the user to the website. Data in cookies is stored in key:value pairs. Data that's stored in cookies helps websites access that data and transfer certain saved values in the form of a quick interaction.
Cookies also allow websites to track user profiles, their web habits, and so on, and use such information for indexing, page ads, and marketing activities.
Cookie-based data can last for a session (that is, from the time that a web page is loaded until the browser is closed) forming what are known as a session cookies, or for days, weeks, or months, which are known as permanent or stored cookies. Cookies can also contain expiry values in seconds and are expired or deleted from the system once the period of time expressed in this value elapses.