Sessions
We'll need to...
Install
express-session
middlewareSetup the session module
In order to save whether the user is logged in or not, we'll need to create a persistent session for each user. Each session will associate data with a user, and each user will be mapped to their data via a value stored in a cookie. Instead of directly altering the session, we'll use a third-party module called Passport to do it for us.
Install express-session
Setup the session module
server.js
.env
Session finished
To verify that this session works, we'll start setting up Passport and login functionality in the next section. There are no tests associated with the sessions right now.
Last updated