I have spring boot app with cookie-based authentication and session management. For the first request I receive cookie names and session hashes as values.
On the other side, I have React Native app wrapped with Expo. For the first request ever made I can get this 'set-cookie' header from fetch() request. Then, even after restarting the app, I can't get this header.
I debugged it with React Native Debugger and with this line of code:
GLOBAL.XMLHttpRequest = GLOBAL.originalXMLHttpRequest || GLOBAL.XMLHttpRequest;
I can see my XHR requests on network tab in debugger. After cleaning all the cookies, every time I'm receiving properly set-cookie header in request's preview. But I can't see it with fetch(...).then(response => response.headers).
Why? It's something persisting my cookie? How to handle cookie data and save it to AsyncStorage without plugins/libraries?