A cookie is a text file that a Web browser stores on a user’s machine.
There are two types of cookies: session cookies and persistent cookies.
Cookies are a way for Web applications to maintain application state. They are used by websites for authentication, storing website information/preferences, other browsing information and anything else that can help the Web browser while accessing Web servers. HTTP cookies are known by many different names, including browser cookies, Web cookies or HTTP cookies.
Cookies are often indispensable for websites that have huge databases, need logins, have customizable themes, other advanced features.