RedditPP Mascot

RedditPP

r/reactnative • … • u/NFTrot

Cookies are missing in react native, but not when run in nodeJS

Hi everyone,

I don't have too much experience with React Native, and this has problem I'm having really has left me scratching my head.

I'm working on an app where a user can log into their Instagram account, I have done this before for desktop using Electron (which supports NodeJS) and Python. The problem I'm having is that when I log in using Node or Python, the csrftoken and 2 other session cookies are stored, but for some reason when I try to do this in React Native only the csrftoken comes in.

To keep my codebases similar I used rn-nodeify to shim in some browser variants of the nodejs imports that I used in the Electron version (I'm using the request library for http requests), but I also tried using Axios and the result is the same.

I was thinking this was some sort of a CORS issue but my research leads be to believe CORS isn't a factor with native apps.

Any advice you guys could offer would be appreciated. Thanks very much in advance.

— 0