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

Inspecting the session object

From the course: Advanced Express

Start my 1-month free trial

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…

Contents