O'Reilly logo

Sams Teach Yourself PHP, MySQL® and Apache All in One, Fifth Edition by Julie Meloni

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 12. Working with Cookies and User Sessions

In this chapter, you learn the following:

How to store and retrieve cookie information

What session variables are and how they work

How to start or resume a session

How to store variables in a session

How to destroy a session

How to unset session variables

PHP contains numerous functions for managing and keeping track of user information, including both simple cookies and all-encompassing user sessions. Sessions use techniques built in to the PHP language, making the act of saving state as easy as referencing a superglobal variable.

Introducing Cookies

You can use cookies within your PHP scripts to store small bits of information about a user. A cookie is a small amount of data ...

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