Home » Android » Android Webview: Having separate(temporary) cookies for private mode

Android Webview: Having separate(temporary) cookies for private mode

Posted by: admin May 14, 2020 Leave a comment

Questions:

Aim: To have cookies in private/incognito mode of a webview, but they should be deleted after the user closes this tab.

Problem: CookieManager in android is singleton, and setting or deleting cookies for any single instance of a webview will also affect other instances of the webview.

What could be a possible way of tackling this problem?

Thanks in advance!

How to&Answers: