Chapter 6. Persistent Data Using Sessions and Cookies

Anytime you browse to almost any major website on the Internet today, the server will send your client a “cookie.” What are these cookies? They are small packets of data that are stored in your browser's cache. Every time you visit that website, the browser will send that data back to the server. So why is this useful? To appreciate cookies, you'll need to first understand a little bit more about the HTTP protocol.

HTTP Cookies

Although quite useful as a protocol, HTTP is known in the computer science world as a “stateless” protocol. If that doesn't make sense to you, don't worry. Unlike your favorite programs that you run on your ...

Get PHP 5 Unleashed 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.