Cookies are small text files that are placed on your computer or mobile device when you browse most websites. They are used by web developers to make websites work, or work more efficiently, as well as improving your browsing experience by including additional functionality. This can range from saving your settings during and between visits to noting your site visit for analytical purposes.
Session cookies expire as soon you close the browser and are most commonly used to help users navigate the site by storing information on their location and the pages they have visited. An example of this could be a site with a login process; in order for the site to remember that you are logged in a cookie must be stored, otherwise every time you move to a new page you will be logged out.
Persistent or permanent cookies remain on your computer once you have closed the browser down, relying on a time limit for self-deletion. Most of these range from 30 days to 1 year, but it's possible for them to last until 3012. These are most commonly used for personalising a web experience, so that the site "remembers" you from previous visits, or other sites, and can display relevant information.
All cookies can be permanently disabled using your browser's security options, although most websites will fail to function correctly without cookies.