DEV Community

Discussion on: How to Secure JWT in a Single-Page Application

Collapse
 
shivarajnaidu profile image
yuvaraj

What if we are using separate domain for APIs ?

Can we store the cookies in our SPA when we are consuming APIs (domain y) from domain x ?

Now a days browsers blocking 3r party cookies .. if we do so it can break the site right ?

Collapse
 
ecyrbe profile image
ecyrbe

You Can setup cookies with cors by adding Access-Control-Allow-Credentials
and to explicitly setup Acess-Control-Allow-Origin to your main domain.

Collapse
 
shivarajnaidu profile image
yuvaraj

You mean sub domain and main domain ?

Collapse
 
shivarajnaidu profile image
yuvaraj

Also now days its becomes common to block third party cookies in browsers .. in that case if we use diffrent domain it may break the flow right ?

Some comments have been hidden by the post's author - find out more