From the course: Databases for Node.js Developers
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Managing user sessions with Redis - Node.js Tutorial
From the course: Databases for Node.js Developers
Managing user sessions with Redis
- [Narrator] In our current setup, we are using fastifySecureSession to manage client-side encrypted sessions. All this happens here in plugins, session.js. And if we look at it, you see that we are dealing here with the current users. So when we are logging in, also all the messages stuff is happening here. And we are using also this session file here to then edit to reply locals to make it available to the whole site. But you see we are relying on sessions already. Right now, we are encrypting the session data at the client level. This means that it's stored at the client and the client then sends it with each request and there, we unpack it. This works but it also makes the cookies larger. It's a little bit of a performance hog and also, it's not the best practice to do it like that. Usually, you rely on server-side sessions and just store the session ID in the cookie. Very often, Redis is used for that and we will now change our session management system to use Redis under the…
Contents
-
-
-
-
-
-
-
(Locked)
Fast and flexible basket and session management with Redis2m 3s
-
(Locked)
Setting up Redis with Docker1m 37s
-
(Locked)
Exploring Redis with Redis Insight2m 36s
-
(Locked)
Connecting our application to Redis4m 35s
-
(Locked)
Managing user sessions with Redis8m 50s
-
(Locked)
Basic Redis operations for shopping baskets, part 111m 16s
-
(Locked)
Basic Redis operations for shopping baskets, part 27m 47s
-
(Locked)
-
-