Carl fills out a Web form with his name, address, and other information. Cookies can be used to store or reference this information so that the next time Carl visits the site, the information is automatically uploaded and he doesn't have to provide it again. If the form contains sensitive information such as a credit card number or a mailing address, the cookies can be delivered over Secure Sockets Layer, which encrypts the information as it travels between the client and server. Charlie logs in to a Web site that requires a user name and password. After a set time period, perhaps half an hour or a day, the guest pass expires and Charlie must log in again.
Cookies can only store data that is provided by the server or generated by an explicit user action.
Cookies can be used to store any information that the user volunteers. They cannot be used to gather sensitive information such as the fields in a preference file. Cookies are passive files that are delivered to the client, stored on the client's hard drive, and returned in certain situations to the same server that provided the information in the first place. A Web site may set an expiration date for a cookie it delivers. If no expiration date is specified, the cookie is deleted when the user quits their browser.