Search code examples
reactjssessionexpressexpress-session

Session Sharing react/express


So,I have already set up an express server and passport for facebook auth.However if I serve react with nginx in a different server than express how would it be possible to share session data?


Solution

  • You can have your React app proxy to a route on your Express server, which will call req.isAuthenticated().

    isAuthenticated() will return true/false depending on if the user is logged in.