Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers not working (credentials: 'included'?) #63

Open
coolcomfort opened this issue Dec 17, 2021 · 1 comment
Open

Headers not working (credentials: 'included'?) #63

coolcomfort opened this issue Dec 17, 2021 · 1 comment

Comments

@coolcomfort
Copy link

coolcomfort commented Dec 17, 2021

Hello,

The backend is attempting to set a cookie by using a cookie request. Typically, in front end applications one uses credentials: true or credentials: "included" which then sets the cookie, but this does not seem to be working. In the network tab, I can see the cookie request come in, yet it never actually sticks as a cookie. What setting should I use in my headers to enable credentials?

    var graph = graphql("http://localhost:3000/api/graphql", {
        headers: {
            credentials: "include",
            "Authorization": "",
        },
        asJSON: true,
    });

Thank you

@coolcomfort
Copy link
Author

I ended up getting this to work, make sure domains are from same origin (aka localhost to localhost, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant