title: Req.session.users not available in other routes
body: <p>i guys I am currently using nodejs with express session and connect session sequelize.</p>
  <p>Currently I am trying to pass my userID from session and to be accessed at another add product page. So that the database can identify based on userID. I am getting req.session.users is not a function.</p>
  <p>Below is my code.</p>
  <p>Sessions login page:</p>
  <pre><code>const User = require('../models/user')
  
  exports.postLoginPage = (req,res,next) =&gt;{
  
  User.findByPk(1)
          .then(users =&gt;{
  req.session.isLoggedIn = true;
  req.session.users = users;
  res.redirect('/');
          })
          .catch(err =&gt;{
  console.log(err)
          })
  
  }
  </code></pre>
  <p>the addProduct Page</p>
  <pre><code>exports.postaddProductsMale = (req,res,next) =&gt;{
  const title = req.body.title;
  const imageUrl = req.body.imageUrl;
  const price = req.body.price;
  console.log(+req.session.users)
  req.session.users.createProduct({
  title:title,
  imageUrl:imageUrl,
  price:price
    })
      .then(results =&gt;{
  console.log('Product created')
  res.redirect('male_section');
      })
      .catch(err =&gt;{
  console.log(err)
      })
  };
  
  </code></pre>
  <p>this is my error :</p>
  <pre><code>TypeError: req.session.users.createProduct is not a function
     at exports.postaddProductsMale (C:\Users\ASUS\Desktop\Hobby\projects\javascript\ecommerce clothing\maarancode\controllers\admin.js:28:23
  </code></pre>
  <p>I can get the data to the other routes using req.user not sure why req.session.users is not working.</p>
  <p>Appreciate your feedback on this question. Thank you.</p>