cookie-session use in node 1

cookie-session use in node

app.use(
  cookieSession({
    maxAge: 30 * 24 * 60 * 60 * 1000,
    keys: [keys.cookieKey]
  })
);
app.use(passport.initialize());
app.use(passport.session());

Here is what the above code is Doing:
1. We are requiring the cookieSession library.
2. We are telling our app to use cookieSession.
3. We are telling our app to use passport.
4. We are telling our app to use passport’s session.

Similar Posts