How does express-session set connect_sid

  node.js, question

I try to create a user object to save when using sessionconnect_id

app.use(session({
 name:"Owen 's site",
 url: "localhost:5000",
 secret: "Owen 's try",
 resave: true,
 saveUninitialized: true,
 cookie: {maxAge: 60 * 1000},
 user: {}
 }));

But when I used it in the route, I couldn’t find the user object

app.post("/sign-up",function (req, res) {
 console.log(req.session.user) // underfined
 })

Q: 1. Where do I store connect_id? 2. store connect_id like this

In addition, I have a doubt that if the server restarts before the expiration time of connect_id ends, then the connect_id cache existing in the server will not exist.

However, there will still be this id value in the cookie of another user. What kind of problems will this cause?
How to solve this problem?

The default value should be stored in the memory. If the server restarts, the data in the session will be lost. If the value in the cookie is not found, the server will query the corresponding session value according to the value. If it cannot be found, it means there is no permission. Your code can add logic. If there is no session, you can log in again.

You can store the session with redis, and the corresponding packages are

connect-redis