I am using passport-facebook with ReactJS front-end and NodeJS backend. I am calling the facebook login page using href tag as that's the only way but struggling to send the response back to the front end and set the session identifier in the cookie. Does anyone have any experience with this?

Adding some code as the question in itself didn't make much sense -

So on the React side, I am calling the facebook login using href tag like this - 

```
<a href="https://localhost:3001/api/auth/facebook" class="btn btn-primary"><span class="fa fa-facebook"></span> Login with Facebook</a>

```

This calls the passport code placed in my server.js - 

```
router.get('/auth/facebook', passport.authenticate('facebook', {
  scope: ['public_profile', 'email']
}));

```

As per the callback set in my Facebook App, this gets called -

```
router.get('/auth/facebook/callback',
  passport.authenticate('facebook', { failureRedirect: '/login' }),
  function (req, res) {
    console.log('req.user - ' + req.user);
  res.redirect(`http://localhost:3000/profile`);
  });

```

**Now, if I use res.redirect, I am not able to set the session in the cookie.** 
In my local authentication flow, I can send the response from server.js to front-end using res.json and I can do all that before rendering the component.

Also, how do I store the url end-point where the user actually wanted to go so that I can redirect to that after the login is successful? Again, it was pretty straightforward in the local authentication.

Thanks,
Abhishek