{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/12956","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/12956/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/12956/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/12956/events","html_url":"https://github.com/facebook/react-native/issues/12956","id":214467699,"number":12956,"title":"fetch API on Android doesn't respect credentials: omit","user":{"login":"Ashoat","id":863579,"avatar_url":"https://avatars0.githubusercontent.com/u/863579?v=4","gravatar_id":"","url":"https://api.github.com/users/Ashoat","html_url":"https://github.com/Ashoat","followers_url":"https://api.github.com/users/Ashoat/followers","following_url":"https://api.github.com/users/Ashoat/following{/other_user}","gists_url":"https://api.github.com/users/Ashoat/gists{/gist_id}","starred_url":"https://api.github.com/users/Ashoat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ashoat/subscriptions","organizations_url":"https://api.github.com/users/Ashoat/orgs","repos_url":"https://api.github.com/users/Ashoat/repos","events_url":"https://api.github.com/users/Ashoat/events{/privacy}","received_events_url":"https://api.github.com/users/Ashoat/received_events","type":"User","site_admin":false},"labels":[{"id":260305031,"url":"https://api.github.com/repos/facebook/react-native/labels/Android","name":"Android","color":"bfe5bf","default":false},{"id":470317962,"url":"https://api.github.com/repos/facebook/react-native/labels/Icebox","name":"Icebox","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-03-15T17:30:00Z","updated_at":"2017-07-31T21:55:02Z","closed_at":"2017-07-31T21:55:02Z","body":"### Description\r\n\r\nIf Android's native networking library detects valid cookies for a particular network request it will always tack those cookies onto the request, even if `credentials: \"omit\"` is passed to the fetch API.\r\n\r\nThis problem has been reported multiple times in #1274, which is an related issue that has been closed. I wanted to create a new issue to track it.\r\n\r\nThis problem makes it very difficult to fully encapsulate cookie logic within Javascript, and necessitates interacting directly with native cookie storage with something like `react-native-cookies`. This is unfortunate, as there is no particular reason that cookies ought to be handled natively, and outside of this problem it is possible to handle cookies entirely in Javascript.\r\n\r\n### Reproduction\r\n\r\n1. First, get a cookie set on the client by hitting a server endpoint that returns a `Set-Cookie` header.\r\n2. On Android,\r\n```javascript\r\nawait fetch(\r\n  credentials: 'omit',\r\n  ...\r\n);\r\n```\r\n3. Add some logging code on the server to see if a `Cookie` header is set by client. Confirm that this is happening.\r\n\r\n### Solution\r\n\r\nReact Native on Android should respect the `credentials: 'omit'` option.\r\n\r\n### Additional Information\r\n\r\n* React Native version: 42\r\n* Platform: Android only\r\n* Operating System: macOS"}}
{"actor":{"display_login":"hramos"}}