A cookie is a simple name-value pair stored by a browser, often a session ID.
The main purpose of cookies is to identify users and possibly prepare customised web pages for them. When you connect to a web site using cookies, you may be asked to fill out a form providing information such as your name and interests.
This information is packaged into a cookie and sent to your web browser which stores it for later use. The next time you go to the same web site, your browser will send the cookie to the web server. The server can use this information to present you with custom web pages. So, for example, instead of seeing just a generic welcome page you might see a welcome page with your name on it.