A cookie is a small data file that is stored in web browsers. There are a variety of different types of cookies including first-party cookies, third-party cookies, session cookies and persistent cookies, and each type serves a different purpose.