react-native: Set-Cookie response header is not working on react-native 0.44.0

I have created a Github repo for showcasing the bug.

Problem

When App make a XHR request for login. Login server sends cookie. App send XHR to get data and server read auth cookie on XHR. This is working fine with Android. However same code is not working with iPhone. At server side I am getting following logs. JWT token is undefined

How to reproduce this bug

cd react-native-cookie-bug
yarn install
react-native run-ios

On iPhone Simulator, this will print like this

image

On Android , this print like this image

Online Demo

Created https://snack.expo.io/BJAHjhMb- online demo, but here things are working fine because they are using Expo 16 which use react 0.43.4 where this bug do not present.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

@nsisodiya You should try this fetch(url, { credentials: ‘include’, …otherOptions, });