5.6. Storing State for a Stateless Server: Cookies

HTTP allows Web clients and servers to introduce new headers that are not specified in the standard, as long as these headers follow the general "keyword:value" structure. HTTP stipulates that clients and servers that do not understand the new headers should ignore them. This provision for new headers has become a great facilitator of innovation, allowing the graceful introduction of new functionalities to HTTP. The cookie mechanism [Kristol and Montulli 1997], which is not part of standard HTTP, is a prime example of such innovation. It provides an elegant mechanism to store state between Web interactions while retaining the stateless nature of HTTP servers. For example, a cookie can record ...

Get Web Caching and Replication now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.