Closed as not planned
Description
Description
Currently, it's not possible to get the Set-Cookie
headers from http requests, specifically via headers.getSetCookie()
.
I've started work on this:
Plan for next steps:
- Make sure changes to Android part works
- Also update iOS to send array instead of map
- Update JavaScript part to receive array instead of map
- Test that this works
If anyone wants to help out, feel free to!
Steps to reproduce
Snack: https://snack.expo.dev/@linusu/authentic-yellow-soda
Relevant code:
const response = await fetch('https://httpbin.org/cookies/set?x=x&y=y')
const cookies = response.headers.getSetCookie()
// cookies should be ["x=x", "y=y"]
React Native Version
0.74.5
Affected Platforms
Runtime - Android, Runtime - iOS
Output of npx react-native info
System:
OS: macOS 15.0.1
CPU: (11) arm64 Apple M3 Pro
Memory: 1001.42 MB / 36.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.16.0
path: ~/Library/Caches/fnm_multishells/42255_1729074242539/bin/node
Yarn:
version: 1.22.22
path: /opt/homebrew/bin/yarn
npm:
version: 10.8.1
path: ~/Library/Caches/fnm_multishells/42255_1729074242539/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.0
- iOS 18.0
- macOS 15.0
- tvOS 18.0
- visionOS 2.0
- watchOS 11.0
Android SDK: Not Found
IDEs:
Android Studio: 2024.2 AI-242.21829.142.2421.12409432
Xcode:
version: 16.0/16A242d
path: /usr/bin/xcodebuild
Languages:
Java:
version: javac 23
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.5
wanted: 0.74.5
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
TypeError: response.headers.getSetCookie is not a function (it is undefined)
Reproducer
https://snack.expo.dev/@linusu/authentic-yellow-soda
Screenshots and Videos
No response