Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introduction to User Authentication in PHP!
You have completed Introduction to User Authentication in PHP!
Preview
The final part of logging in, is a logout system. Let's reverse the logic for log in.
$session->remove('auth_logged_in');
$session->remove('auth_user_id');
$session->remove('auth_roles');
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
We'll name this doLogout.php.
0:02
And once again,
we'll need the bootstrap file.
0:09
Let's copy from here.
0:13
Okay, to log out a user
we need to remove all
0:19
the authenticated sessions
that we set on log in.
0:23
So let's copy those from our doLogin.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up