[Tutorial] An Introduction to Node.js Servers (and Express.js)

AWS has a page about it here:

You can also use it with Express for storing session information. (express-session and connect-redis)

If you go to the homepage of Code Self Study and open the browser’s developer tools and click on the storage tab, there’s a cookie there named alice that stores some information about the user in Redis on the server. The data isn’t in the cookie on the browser side but when the cookie is sent to the server on every request, the server can look up the data in Redis with the information.

Here’s an example of how you could use it to count the number of page view for a specific user.

I added it because the code that logs people into the Express site using forum accounts needs to temporarily save some data in the session while the user gets redirected to the forum and back. (That feature isn’t live yet.)

2 Likes

Express 5 is in beta

1 Like