A primer on cookies.
An HTTP cookie is key/value pair used to store data in the browser. Since HTTP is stateless, cookies can send cookies to the server to create 'state'.
A cookie has three main things:
Cookies are mainly used for three main purposes:
Servers can set a cookie on a browser using the Set-Cookie
HTTP header. Browser can send that back through a Cookie
HTTP header. Remember that servers don't store cookies. They use sessions.
Remember that users can easily edit/supply their own cookies, so consider the security implications.