[ Team LiB ] Previous Section Next Section

Hour 20. Saving State with Session Functions

What You'll Learn in This Hour:

  • What session variables are and how they work

  • How to start or resume a session

  • How to work with variables in a session

  • How to destroy a session

  • How to unset session variables

In the previous hour, we looked at saving state from page to page, using a cookie or a query string. Once again, PHP is one step ahead of us. As of PHP 4, functions for managing user sessions were built in to the language. These use techniques similar to those explored in the previous hour but build them into the language, making saving state as easy as calling a function.

    [ Team LiB ] Previous Section Next Section