A cookie is a small text file, typically of letters and numbers, downloaded to your computer when you access websites. Typically, they contain the following information: a site name and unique user ID, the duration of the cookie's abilities and effects, and a random number. As a rule, cookies cannot be used to reveal your identity or personally identifying information.
Generally, the role of cookies is beneficial, making your interaction with frequently-visited sites smoother with no extra effort on your part. Without cookies, online shopping would be much harder. Without cookies, some websites will become less interactive with the cookie option turned off.
These cookies expire when you close your web browser (Internet Explorer, Firefox, Safari, Google Chrome). These cookies are used for various reasons, for example, remembering what you have put in your shopping basket as you browse a website. They can also be used for security to access your Internet banking or email.
These cookies are still stored on your computer after you have closed your web browser which allows your preferences on websites to be remembered. These cookies are used for a variety of purposes, for example, remembering your preferences on a website (your language choice or your user name on a particular website).
First and Third Party cookies
This refers to the website placing the cookie. First party cookies are cookies set by the website you are visiting. Third party cookies are set by another website; the website you are visiting may have advertising on the page and this other website will be able to set a cookie on your computer. Third party cookies on the main web browsers allow third party cookies by default. Changing the settings on your browsers can prevent this.
There are some exemptions to the above where it is essential for a website to store information on your computer, for example, to provide a service to you that you have requested.
Further information can be found at https://ico.org.uk/for-organisations/guide-to-pecr/cookies-and-similar-technologies/ and http://www.allaboutcookies.org/.