O'Reilly logo

PHP, MySQL, & JavaScript All-in-One For Dummies by Richard Blum

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 6

Sessions and Carts

IN THIS CHAPTER

check Storing data

check Using cookies

check Working with sessions

check Playing with carts

In the previous chapters of this minibook, I show you how to use the HTTP GET and POST methods to send data from one web page to another. Although they work fine for clicking links and submitting forms, they're somewhat impractical to use for sharing data between all the web pages in an application. To do that requires some other form of persistent data, someplace where you can temporarily store it so that your PHP programs can access the data at any time from any page. This is where sessions and carts help out. This chapter explains how they work, why you shouldn’t be afraid of them, and how to use them as another piece of your dynamic web applications.

Storing Persistent Data

Most dynamic web applications require some way of temporarily storing data while site visitors work their way through the application web pages. I’m not talking about long-term storage of data (I cover that in the next minibook). I’m talking about short-term storage of data that one web page can ...

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