Skip to content

Access response cookies? #2316

Discussion options

You must be logged in to vote

Hey Lucas 👋

I think there must be a way to use an exchange to, whenever I receive a set-cookie header, set those cookies.

With any other kind of header, this is totally the route to take! Unfortunately, for security reasons, it looks like we wouldn't be able to access cookie information from a response.

Am I right in thinking your issue is that cookies aren't being passed in future requests?

If the request is on the same origin, you should see cookies being included in any request by default. For cross origin requests, you might need to tell the browser to include cross-origin cookies.

const urql = createClient({
  url: "https://some-cross-origin.domain"
  fetchOptions: {
    credentials: 

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@Lucasmiguelmac
Comment options

@andyrichardson
Comment options

@DoisKoh
Comment options

Answer selected by kitten
Comment options

You must be logged in to vote
1 reply
@abrunner94
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants