An HTTP cookie (also called web cookie, Internet cookie, browser cookie, or simply cookie) is a small block of data created by a web server while a user browses a website and placed on the user's device by the browser. Cookies can store stateful information, such as items in an online shopping cart, and can track browsing activity or keep users logged in. Their use raises privacy concerns, which led lawmakers in Europe and the United States to act in 2011.
Origin and development

The term cookie was coined by web-browser programmer Lou Montulli, who borrowed it from the term magic cookie, a packet of data that Unix programmers used. In 1994, Montulli proposed using cookies in web communications while working at Netscape Communications, where they offered a way to store transaction state on each user's computer instead of on the server. The public learned about cookies in 1996, when media attention focused on their privacy implications. A working group of the Internet Engineering Task Force later produced formal specifications, which were eventually replaced by RFC 6265 in 2011.
Types of cookies
A session cookie exists only in temporary memory and is deleted when the browser closes. A persistent cookie expires at a set date or after a set period, and its information is sent to the server on each visit, which makes it useful for tracking browsing habits and keeping users logged in. A secure cookie is transmitted only over encrypted HTTPS connections, which makes it less exposed to eavesdropping. European law requires websites targeting EU member states to obtain informed consent before storing non-essential cookies.
