express javascript node.js

How to redirect to different domain with a cookie in Express js

I’m developing a web app using Express on Node. I’m trying to implement a proxy login functionality where an user is directly logged in and redirected to another site after he logs into to my site.

In my routing function I’m writing the following code

res.cookie(‘fanws’, ‘value’ );

res.redirect(‘http://hostname/path‘); // another site

I used the debugger in chrome and saw that the cookie is not getting added in the redirected page.

I’m running the app on localhost and the site which i’m redirecting to is hosted on another server on local network.

What should I do to add the cookie on the redirected path?