There are two main types of cookies - session cookies and persistent cookies.
Session cookies only last during a single visit. When a user closes their web browser the session cookie information is automatically removed from their computer.
The user’s web browser stores persistent cookies even when the web browser has been closed, so that the next time a user goes back to the website that originally set the cookie, the web site can read information back from the cookie. Persistent cookies have an expiry date which controls when they are automatically deleted. This can be anything from a few minutes to several years.