Clearing Cookies

When we use fetch call to make network calls, the cookies set by server are cached by ‘fetch’. I don’t want to cache the cookies. Or if it does, I want to clear them with one button click.

After some research, I figured this can be done using react-native-cookies. But again, you have to detach from expo for doing that because the automatic linking doesn’t work.

Is there a way to clear cookies without detaching the project?

1 Like

Unfortunately there is no solution for clearing cookies without detaching a project and gaining access to the native APIs. This is because the cookies are managed by the native objective-c network stack. You can track the issue here: https://github.com/facebook/react-native/issues/12956 where other users of React Native are also having this problem.

It looks like the method of using credentials: false is not working on android either. I’m really sorry about this I wish I could be more helpful. But perhaps once this credentials issue is solved, you can just use that to omit cookies from a network request.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.