- Configuring sessions
- Inspecting how session data is stored
- Implementing persistent sessions
- Creating a SQL database to store session data
- Implementing the PHP SessionHandlerInterface
- Writing session data
- Closing and destroying sessions
- Creating an auto-login system with persistent sessions
- Creating persistent logins
- Checking out visitor credentials
- Authenticating users
- Logging out users selectively
Skill Level Intermediate
- [Voiceover] Hi, I'm David Powers. Welcome to Managing PHP Persistent Sessions. In this course I'll show you how to store session data in a MySQL or MariaDB database and how to log in returning users automatically. We'll begin with an overview of how PHP handles sessions and stores session data in plain text files on the web server. Then we'll set up a database to store session data more securely. I'll show you how to define a class to open and close sessions, read and write session variables to the database, destroy sessions and garbage collect out-of-date records.
By default, sessions expire as soon as the browser is closed, but the highlight of this course is an auto-login system that uses a randomly generated single use token that recognizes returning users and preserves their data between visits, even on different computers. I hope you'll find this a useful and challenging project. So join me in Managing PHP Persistent Sessions.