The two most polular types of cookies are Session Cookies and Persistent Cookies. A session cookie is erased when the user closes the Web browser. The session cookie is stored in temporary memory and is not retained after the browser is closed. A persistent cookie expires at a specific date or after a specific length of time. This means for the cookie’s entire lifespan (which can be as long or as short as its creators want), its information will be transmitted to the server every time the user visits the website that it belongs to, or every time the user views a resource, such as an advertisement.
Cookies are sometimes set by domains that are different to the site address and these are typically known as third-party cookies and are typically set by advertisements and content from other sites. These cookies are often used to track a user’s browsing habits, and is often used by to serve advertisements or collect data on the site visitor.