Join David Powers for an in-depth discussion in this video Sessions in Google Chrome, part of PHP: Managing Persistent Sessions.
- I normally use Google Chrome as my default browser, but throughout this course, I'll be using Firefox to test the scripts. I made that decision because Chrome behaves in a non-standard way, if you've installed Google Apps and selected the option to allow background apps to continue running when Chrome is closed. If you want to use Chrome for testing, you need to open the browser's menu at the top right, and then select "Settings". Scroll down to find "Show advanced settings", click that, then scroll down again until you find "System".
Check whether this option is selected: "Continue running background apps "when Google Chrome is closed". If it is selected, like here, you need to de-select it for the exercises to work correctly. This is because, by default, PHP sessions end automatically when the browser is closed. But if this option is selected in Chrome, Chrome keeps the session alive indefinitely. Of course, you can turn this option off only in your own browser. You've got no control over other people's browsers.
Fortunately, this setting won't affect the Persistent sessions described in this course, but it does affect some of the exercises. So if you want to use Chrome, de-select this.
- 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