Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
An overview of how the log in feature of the Bookworm app works.
[MUSIC]
0:00
With the registration part of the app
in place it's time to add the log in
0:04
functionality.
0:08
In this part of the course
we'll add a log in form so
0:10
users who've already registered can
log into the website. In addition we'll
0:12
add a profile page to show the details for
a logged in user.
0:16
This page should only be visible
to someone who's logged in.
0:20
In other words, we need to add
authentication to the profile page.
0:24
In the process, I'll teach you how to
handle HTTP's stateless protocol, so
0:28
that we can keep track of our
users as they visit our site.
0:33
As users click from page to page
in our site, we'll use cookies and
0:36
sessions to keep track of
users that are logged in.
0:40
Let me show you what we gonna build
in the section of the course.
0:44
We'll add a log in form and
a post route that does a few things.
0:46
It makes sure the user supplies values for
email and password.
0:51
It makes sure the supplied email and
password match a user in the database, and
0:55
finally, it authenticates users so
that they can visit the profile page and
0:59
see information specific to them.
1:04
To do this, we'll need to add
a new behind the scenes feature
1:07
to deal with the stateless
nature of the HTTP protocol.
1:10
Time to learn about sessions and cookies.
1:14
You need to sign up for Treehouse in order to download course files.
Sign up