Hour 16. Working with User Sessions

In Hour 15, "Restricting Access to Your Applications," we looked at using cookies to store user-related values, but once again, PHP is one step ahead of us. PHP contains numerous functions for managing user sessions, which can be stored in the $_SESSION superglobal. Sessions use techniques similar to those explored in the preceding hour but build them into the language; thus, saving state is as easy as calling a function.

In this hour, you will learn

  • 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



Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
ISBN: 067232489X
EAN: 2147483647
Year: 2005
Pages: 263

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net