{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/828","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/828/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/828/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/828/events","html_url":"https://github.com/facebookincubator/create-react-app/issues/828","id":180576937,"number":828,"title":"Call API Request from Client-side to use cookie for Authorization","user":{"login":"dzuncoi","id":7270403,"avatar_url":"https://avatars.githubusercontent.com/u/7270403?v=3","gravatar_id":"","url":"https://api.github.com/users/dzuncoi","html_url":"https://github.com/dzuncoi","followers_url":"https://api.github.com/users/dzuncoi/followers","following_url":"https://api.github.com/users/dzuncoi/following{/other_user}","gists_url":"https://api.github.com/users/dzuncoi/gists{/gist_id}","starred_url":"https://api.github.com/users/dzuncoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzuncoi/subscriptions","organizations_url":"https://api.github.com/users/dzuncoi/orgs","repos_url":"https://api.github.com/users/dzuncoi/repos","events_url":"https://api.github.com/users/dzuncoi/events{/privacy}","received_events_url":"https://api.github.com/users/dzuncoi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-03T07:21:33Z","updated_at":"2016-10-03T09:32:18Z","closed_at":"2016-10-03T09:32:18Z","body":"### Description\r\nI am new to React and decide to use `create-react-app` for my next project. Now I have an api server at `myapi.domain.com` and it is authorized by using cookie. In my react project, I use `fetch`  to make request, for example, at `myapi.domain.com/v1/getData`. When I compare this request with the request I type directly to browser address, I can see a difference.\r\n\r\n### Expected behavior\r\nThe `connect.sid` value in `Cookie` field in 2 requests headers are the same. \r\n\r\n### Actual behavior\r\nThe `connect.sid` value in `Cookie` field in 2 requests headers are different, so my api server cannot authorize the request. \r\nI assume that when using `fetch`, the request is not called from client-side, so it cannot get the cookie stored in browser.\r\n\r\nSo in this case, how can I call a request from client-side (to use cookie stored in browser)?\r\n\r\nSorry for my bad English and explanation.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments/251064101","html_url":"https://github.com/facebookincubator/create-react-app/issues/828#issuecomment-251064101","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/828","id":251064101,"user":{"login":"dzuncoi","id":7270403,"avatar_url":"https://avatars.githubusercontent.com/u/7270403?v=3","gravatar_id":"","url":"https://api.github.com/users/dzuncoi","html_url":"https://github.com/dzuncoi","followers_url":"https://api.github.com/users/dzuncoi/followers","following_url":"https://api.github.com/users/dzuncoi/following{/other_user}","gists_url":"https://api.github.com/users/dzuncoi/gists{/gist_id}","starred_url":"https://api.github.com/users/dzuncoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzuncoi/subscriptions","organizations_url":"https://api.github.com/users/dzuncoi/orgs","repos_url":"https://api.github.com/users/dzuncoi/repos","events_url":"https://api.github.com/users/dzuncoi/events{/privacy}","received_events_url":"https://api.github.com/users/dzuncoi/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T09:32:18Z","updated_at":"2016-10-03T09:32:18Z","body":"@shrynx Thanks for your quick responses, especially `withCredentials: true` in the 2nd one, now I use `credentials: 'include'` in `fetch` and problem is solved. \r\nThanks.\r\n"}}
{"actor":{"display_login":"dzuncoi"}}