react-native-cookies icon indicating copy to clipboard operation
react-native-cookies copied to clipboard

Better document purpose of this library?

Open slorber opened this issue 8 years ago • 1 comments

Hi,

This may seem crazy but I'm not sure to understand why this library should be used.

Is it possible to explain some common usecases?

The first question that comes to mind is weither or not this library can be used for cookie-based auth. Will cookies be automatically sent in every server request if I use fetch(url) for example?

Or is this library just some utility to parse cookies from response, and put them in some storage space?

slorber avatar Jul 21 '17 12:07 slorber

I can tell you why I'm using this library. I'm developing an app which uses cookie-based auth. Using fetch these cookies are automatically set on my requests. This is causing a few problems for me on requests when I do not want to use cookies. Setting credentials: 'omit' is supposed to remove the cookies from the request, but it is not currently working. Other people have had this problem and the work around seems to be using this library.

See https://github.com/facebook/react-native/issues/1274

I also had a problem where if I set a cookie in the fetch header that cookie would just be added to the current cookies. It would not override the cookie with same name. Using this library I saw able to set and override those cookies.

nolan-m avatar Aug 24 '17 21:08 nolan-m