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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access