Skip to content

"Set-Cookie" contains only last item #22064

Closed
@dakiesse

Description

@dakiesse

Environment

React Native Environment Info:
  System:
    OS: macOS 10.14
    CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 65.45 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 11.0.0 - /usr/local/bin/node
    Yarn: 1.10.1 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      Build Tools: 25.0.0, 26.0.3, 27.0.3
      API Levels: 23, 25, 26, 27
  IDEs:
    Android Studio: 3.0 AI-171.4443003
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
    react-native: 0.57.4 => 0.57.4
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-create-library: 3.1.2

Description

My backend send a response with several "Set-Cookie":

some1=value1
some2=value2

If I make a request to endpoint via Postman I'll get this:

image

That's OK!

If I make the request through React Native I'll get only last "Set-Cookie" in the response:

image

I made requests via xmlHttpRequest and fetch. The result is the same.

Reproducible Demo

New project + append the code there:

export default class App extends Component<Props> {
  async componentDidMount() {
    const response = await fetch('http://localhost:3333/test')

    console.warn({fh: response.headers})
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions