O'Reilly logo

PHP Advanced for the World Wide Web: Visual QuickPro Guide by Larry Ullman

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

Sessions

One of the many very useful additions to PHP is built-in session support. Because HTTP is in itself a stateless protocol—in other words, nothing can be remembered about the user's history without some assistance—developers use different techniques such as cookies and sessions to create a sense of what the user has experienced. Where the user has been, the values of variables, and so forth can be stored on the server and associated with the user. A session, in short, is like a log of a user's visit to a site.

Previously, to create sessions, a programmer had to write an entire library of code that created a unique session name, stored information in a database or text file, sent and read a cookie, and retrieved the stored data. Even though ...

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