title: Hiding Routes in React Header based on Express.js User login status
body: <p>I have an application that uses <em>express.js</em> as the server side language and <em>React</em> on the front-end. I use <em>passport.js</em> to authenticate routes in the server, using local login and facebook strategies (no JWT). I use <em>express-session</em> to manage the session, which seems straight forward ( or insufficient, which I do not know yet, for my case, as its work in progress ). </p>
  
  <p>My requirement is to hide/show few links in the Header component. 
  i.e.,</p>
  
  <ul>
  <li>Log In</li>
  <li>Sign Up</li>
  </ul>
  
  <p>should show up in index page, when user has not logged in, but hidden when he is logged in. Likewise, few links should be hidden when the user is not yet logged in. </p>
  
  <p>What is the best wat to check this from the client? Making an AJAX call is not ideal, as I may have more use cases of checking if the user session is valid from the client. </p>
  
  <p>I can see the default <em>connect.sid</em> cookie, which the express creates, but how do I make use of it, or is there a best way for the client to know that the user is already logged in. </p>