O'Reilly logo

Jump Start PHP by Callum Hopkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5Sessions and Cookies

As we've discussed, databases are ideal for storing permanently storing data that an application can retrieve at a later date. There are, however, some options for storing data on a more temporary basis with PHP. Cookies and sessions are designed to hold smaller chunks of data than would normally be held in a database. They're often used to hold users' personal data for login functionality, for example, and to provide quick access to user data for functionality like application profiles.

The big difference between cookies and sessions is where the data is stored. Cookies store data on the client's computer, while sessions store their data on the web server. PHP can work with both cookies and sessions, and we'll take ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required