Our goal as website programmers should be to make the website experience as easy and pleasant for the user as possible. Clearly, well-designed pages with easily navigable layout are central to this, but they're not the whole story. We can go one step further by learning about our users and using information gained about them to personalize the website.
For example, imagine a user, whose name we asked on the first visit, returns to our website. We could welcome the user back to the website by greeting him or her by name. Another good example is given by a website, such as Amazon's, which incorporates the one-click purchasing system. By already knowing the user's purchasing details, such as credit card number and delivery address, we can allow the user to go from viewing a book to buying it in just one click, making the likelihood of the user purchasing it that much greater. Also, based on information, such as the previous purchases and browsing patterns of the user, it's possible to make book suggestions to the user.
Such personalization on websites requires that information about users be stored somewhere in between their visits to the website. We've previously talked about the fact that accessing the user's local file system from a web application is pretty much off limits due to security restrictions included in browsers. However, we, as website developers, can store small amounts of information in a special place on the user's local disc, using what is called a cookie. There may be a logical reason why they are named cookies, but it also provides authors with the opportunity to make a lot of second-rate, food-related jokes!