Have you ever wanted to store information about the user, for their current working session in the application? Perhaps you want to keep track of what pages they have viewed, or what features they have used. Maybe you need to store some configuration or user preferences and you don't want to re-calculate the settings every time a page request is made?
With the Express-Session middleware, you can accomplish these things and much more. The Session provides a way to save information about the current user – whether or not they are logged in – and use that information elsewhere in the application.
In this episode, then, you'll see how to install and configure this piece of middleware. You'll also learn how to use it to track page views, and see what happens if you stop and restart your server.
Middleware is indeed a powerful mechanism for handling features in an Express application, as you have been learning – and the express-session middleware is no exception this!