Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear react native webview cookies?

How to clear react native webview cookies?

When I re-open the page, it remembers my account if I logged in on a website. But I don't want that.

Can I do this by injecting javascript?

like image 940
Emre Tekince Avatar asked Jun 16 '17 20:06

Emre Tekince


People also ask

How do I clear WebView cache in react native?

For android, the "App info" setting, under Storage will allow you to clear cache. This is how you can force a reload of any resources you are displaying in the WebView.

How do you handle cookies in react native?

Here is how I currently set it on the Login. js file in React Native: import Cookies from "universal-cookie"; const cookies = new Cookies(); cookies. set("token", token, { expires: 7, // 7 days path: "/" //,secure: true // If served over HTTPS });


1 Answers

Solved by using this: https://github.com/react-native-community/react-native-cookies

CookieManager.clearAll();
like image 110
Emre Tekince Avatar answered Oct 24 '22 14:10

Emre Tekince