Apollo client send cookie with request

Apollo client send cookie with request


0

I configured my apollo client to send cookies in every request:

apollo: {
    clients: {
      default: {
        httpLinkOptions: {
          credentials: 'include',
        },
        httpEndpoint: `${process.env.NUXT_ENV_GRAPH_URL}`,
      },
    },
  },

My app is holding following cookies:

Apollo client send cookie with request

Now when I perform mutation to graphql I see that none of above cookies is sent instead it creates some new cookie and attach it to request:

Apollo client send cookie with request

And now without reloading the page if I go back to cookies tab in devtools, I see that new cookie is created:

Apollo client send cookie with request

Can I somehow force apollo client to attach access_token cookie instead of creating new one?

1

  • Those cookies seem to be scoped to localhost, but you are sending requests to localhost:3000 here – could it be that you just have completely different cookies in store for that other domain?

    – phry

    47 mins ago


Load 3 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *