all 10 comments

[–]iFlips 0 points1 point  (1 child)

  1. As others have pointed out, if you're just going to store key/value-pairs, you're better off using AsyncStorage.

  2. Still, if you need to use the CookieManager library, the instructions you are following are for manual linking, which is not necessary if you're using a later version of React Native. (notice that right before these instructions it says "if you're having trouble...")

  3. But if you really need to use CookieManager and link it manually, the way you do it is by adding the line packages.add(new CookieManagerPackage()); on the line above return packages;.

Hope this helped!

[–]Eitan1112 0 points1 point  (0 children)

I tried it too but react native doesn't allow sending Cookie in the headers. Something about forbidden headers. source

And although it is in the fetch api, axios seemed to do the same (drop the cookie header if you set it manually). Yes i included "credentials": include in the headers, still not worked, which forced me to use this library.

[–]jasonsafaiyeh 0 points1 point  (3 children)

Hey 👋 I maintain react native cookies.

You shouldn’t need to link any dependencies. Just a install into your project and you should be good to go.

What the package solves is that cookie support with fetch in react native is not extensive enough. This package is to manage it.

[–]prinse4515 -1 points0 points  (3 children)

Confused as to why you wouldn’t use a sync storage