8.5. Session Handling

The functions in this section work with the session-handling capabilities of PHP. This functionality takes some inspiration from session handling in other technologies, such as Microsoft ASP and PHPLIB. The original vision was one of global variables registered as part of a session that persist with each page load. PHP has moved away from global variables created by the core, and I find it prudent to present these functions in that spirit. I recommend the use of _SESSION rather than turning on register_globals. This leads you toward compact, simple code. Chapter 7 discusses the purpose and use of sessions.

Sessions are managed by passing a cookie with a unique value between the server and the browser. This cookie indexes ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.