react-redux-starter-kit icon indicating copy to clipboard operation
react-redux-starter-kit copied to clipboard

Setting cookies for different hosts

Open madshargreave opened this issue 8 years ago • 2 comments

Hi

I host my API on port 4000 and client-side app on 3000

I set a cookie to from the API to authenticate future requests, but it does not get saved in the browser on 3000.

Any ideas on how to set cookies with the starter kit?

madshargreave avatar Dec 10 '16 17:12 madshargreave

Hi, this is a security problem related with cookies domain scoping.

Look at this documentation: http://visionmedia.github.io/superagent/#cors

marcopeg avatar Mar 27 '17 06:03 marcopeg

I recommend js-cookie. You receive the auth token and save it with Cookies.set('authToken', authToken). To get it use Cookies.get('authToken').

piu130 avatar Mar 27 '17 07:03 piu130