1 00:00:00,000 --> 00:00:04,658 [MUSIC] 2 00:00:04,658 --> 00:00:08,980 With the registration part of the app in place it's time to add the log in 3 00:00:08,980 --> 00:00:10,080 functionality. 4 00:00:10,080 --> 00:00:12,530 In this part of the course we'll add a log in form so 5 00:00:12,530 --> 00:00:16,760 users who've already registered can log into the website. In addition we'll 6 00:00:16,760 --> 00:00:20,700 add a profile page to show the details for a logged in user. 7 00:00:20,700 --> 00:00:24,060 This page should only be visible to someone who's logged in. 8 00:00:24,060 --> 00:00:27,000 In other words, we need to add authentication to the profile page. 9 00:00:28,450 --> 00:00:33,480 In the process, I'll teach you how to handle HTTP's stateless protocol, so 10 00:00:33,480 --> 00:00:36,780 that we can keep track of our users as they visit our site. 11 00:00:36,780 --> 00:00:40,520 As users click from page to page in our site, we'll use cookies and 12 00:00:40,520 --> 00:00:43,040 sessions to keep track of users that are logged in. 13 00:00:44,160 --> 00:00:46,465 Let me show you what we gonna build in the section of the course. 14 00:00:46,465 --> 00:00:51,090 We'll add a log in form and a post route that does a few things. 15 00:00:51,090 --> 00:00:55,310 It makes sure the user supplies values for email and password. 16 00:00:55,310 --> 00:00:59,950 It makes sure the supplied email and password match a user in the database, and 17 00:00:59,950 --> 00:01:04,130 finally, it authenticates users so that they can visit the profile page and 18 00:01:04,130 --> 00:01:06,130 see information specific to them. 19 00:01:07,260 --> 00:01:10,560 To do this, we'll need to add a new behind the scenes feature 20 00:01:10,560 --> 00:01:14,420 to deal with the stateless nature of the HTTP protocol. 21 00:01:14,420 --> 00:01:16,320 Time to learn about sessions and cookies.