-
Notifications
You must be signed in to change notification settings - Fork 15
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
Handle cross-domain cookies #13
Comments
I just encountered this problem. What should happen here? I can't see anything in the fetch spec about what to do with cross-domain cookies. A quick test in Chrome, loading http://httpbin.org/response-headers?Set-Cookie=foo%3Dbar%3Bdomain%3Dexample.com%3Bmax-age%3D600%3Bpath%3D%2F does not set any cookies on either httpbin.org or example.com. Would you accept a solution that simply catches and ignores the rejection, here: https://github.com/grantila/fetch-h2/blob/master/lib/fetch-http1.ts#L163? |
That's the question. Either fail the whole fetch request (I don't think that's right), or ignore only the invalid cookies. Catching the exception is a good thing which we want, but not if that means losing valid cookies. I don't know if |
My use case in fact doesn't care about saving cookies because I'm making each request in isolation. I also wonder to what extent you need to do this to be compatible with fetch, because isn't the saving of cookies a network-layer concern below the level of fetch? I wonder if you'd consider a slight rearchitecture, so that a cookie store is a plugin, rather than a core behaviour? |
|
When a server tries to set a cookie with an invalid domain,
tough-cookie
throws.fetch-h2
should handle this.The text was updated successfully, but these errors were encountered: