title: Variable in express-session not being sent to front end with axios
body: <p><strong>My Server code</strong></p>
  <pre><code>router.use(session({
  secret: 'cookie',
  resave:false,
  saveUninitialized: true,
  store:sessionStore,
  cookie:
   {
      secure:false,
      maxAge:1000*24*60*60,
  }
  }));
  
  
  
  router.post('/',
  (req,res)=&gt;{
  
  if(req.session?.isAuth){
  
      res.send({
          isAuth:true,
          message:'Success'
      })
  }
  
  else{
  let name=req.body.name;
  let password=req.body.password;
  db.query('select first_name,password from user_data where first_name=?',[name],(err,result)=&gt;{
          if(result.length&gt;0){
              if(result[0].password===password){
  
                   req.session.isAuth=true;
              res.send(
              {
              isAuth:req.session.isAuth,
               message:'Success'
              })
              }
              else{
                  
              res.send(
                  {
                   isAuth:false,
                   message:'Password incorrect'
                  }
                  );
              }
          }
          else{
              res.send(
              {
                  isAuth:false,
                  message:'User not found'
  
              })
              
          }
  })
  }
  }
  
  )
  
  // Server.js part
  
  
   const loginRouter = require('./routes/login');
  
  app.use('/login',loginRouter);
  </code></pre>
  <p><strong>FrontEnd axios part</strong></p>
  <pre><code>useEffect(()=&gt;{
      axios.post('http://localhost:3001/login',{},{withCredentials:true}).then((res)=&gt;{
        console.log(res.data);
        if(res.data?.isAuth)
        navigate('/home');
        else
        navigate('/')
      })
    },[])
  
  
  // this function runs when the submit button is clicked in login page
  function handler() {
      axios
        .post(&quot;http://localhost:3001/login&quot;, { name, password })
        .then((Response) =&gt; {
          if (Response.data.isAuth) {
            navigate(&quot;/home&quot;);
          } else {
            navigate(&quot;/&quot;);
            setMessage(Response.data);
          }
        });
    }
  </code></pre>
  <p>console log on the useEffect gives me isAuth:false always why is that ?
  When i send a request from thunder client I get isAuth:true every time after i login in there.
  but i dont get the same result in axios ?</p>
  <p>Cookie is begin send to the backend but the isAuth variable is not how can i acess it please help.</p>