Join David Powers for an in-depth discussion in this video Logging out, part of Managing PHP Persistent Sessions.
- The autologin class…preserves session data on every browser or computer…where the user selects the Remember me option.…So it's important to give users the option…to be forgotten, as well.…That's the role of the classes of the logout method.…The definition begins on line 168…and it has a single parameter, all,…which is set by default true, making it optional.…If all is true, the logout method calls the deleteAll method…which was described in the previous video.…
This deletes all records of the autologin table…associated with the current user key.…In other words, it prevents the user…from being automatically logged in on any computer…without going through the normal authentication process…and selecting Remember me again.…If all is false, the else block calls the parseCookie method…to get the single use token from the autologin cookie.…Remember that the token stored as a cookie…is automatically updated…as soon as the user has been authenticated.…
So, the token that's returned this time…is intended for the user's next visit…
- 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
Accessing Databases with Object-Oriented PHPwith David Powers3h 47m Intermediate
1. Sessions and Security
2. Preparing the Database
Connecting to the database5m 49s
3. Storing Session Data in MySQL
4. Creating an Autologin System
5. Testing the Autologin System
Final thoughts3m 9s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.