Hi guys, help wanted: How to send ory cookies to o...
# talk-kratos
e
Hi guys, help wanted: How to send ory cookies to other domain? in frontend
Copy code
const client = new GraphQLClient(endpoint, {
        credentials: 'include',
      })
in api
Copy code
cors: {
        origin: (origin, callback) => {
          callback(null, origin)
        },
        credentials: true,
But it doesn't work
s
what do you mean by "other domain"? cookies are bound to domains, you cannot simply send them wherever you want 😅
e
Actually, you can if the credentials in the case of fetch is set to 'include' and the backend responds with 'access-control-allow-origin' specific to the origin and with 'Access-Control-Allow-Credentials' true. And besides that I should have set the SameSite attribute of
ory_kratos_session
to 'None'. But that is problem now because the origin is http://localhost, which means the cookie Secure flag is set to false and that mess my evil plan of calling our staging backend from my local frontend. Anyways, I will keep searching a solution. Thanks