From the course: Advanced Express
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Inspecting the session object
- [Narrator] With our little visit counter in place, let's use the debugger to inspect what's actually going on in our request.session object. For that, I want to set a break point on line 38. You do that by simply moving the mouse to the spot left of the line number and then click on it so we have a break point. Now, here, and I start the debugger. And I head over to the website and just load the page once. If we now hover over request session, we see that we already have a session object here that holds the cookie, it holds the session ID and also the properties that we set before. And now let's use the debugger to step over to the next line of code and if we now hover over the session object, we already see that there is also now this visits property set. So let's stop the debugger now and remove the break point and I will now simply start the application and I will reload it a few more times. And to see what actually now happened on the database I head over to MongoDB Atlas and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Understanding cookies and sessions3m 54s
-
(Locked)
Adding cookies and sessions to Express5m
-
(Locked)
Inspecting the session object2m 18s
-
Introduction to Passport1m 39s
-
(Locked)
Adding Passport to Express3m 55s
-
(Locked)
Setting up an authentication strategy for Passport5m 18s
-
(Locked)
Serializing and deserializing users3m 25s
-
(Locked)
Creating a login form with Passport5m 14s
-
(Locked)
Providing a logout link2m 1s
-
(Locked)
Authentication vs. authorization1m 23s
-
(Locked)
Protecting routes3m 35s
-
-
-
-