javascript - Restify and Angular JS both are on different domain how can i set httponly cookie using restify response? -


i using rest architecture web application created in restifyjs , frontend of in angular js both running on different domains. example on local restify working on locahost:7000 , angular js working on localhost:5000.

i calling login api frontend , authenticate user restify server , sending token needs set in cookies using not working idea why ?

res.setheader('set-cookie', 'mycookie=test;expires=fri, 13 jun 2017 02:34:20 gmt;domain=localhost;path=/'); 

it's hard without seeing more code, guess have sent body content browser before setheader gets called. possible? setting cookie must take place before else.


Comments