Is it possible to turn off cookie storage in database?

189 views
Skip to first unread message

satishkumar...@gmail.com

unread,
Feb 1, 2018, 10:25:22 AM2/1/18
to android-webview-dev
Hi,

Is it possible to turn off cookie storage in database? I tried calling https://developer.android.com/reference/android/webkit/WebSettings.html#setDatabaseEnabled(boolean) with false. But, I could still see the "Cookies" database having the values in Android 5.1 emulator. But, in Android 7.0 emulator, "Cookies" database file is present, but no tables are present inside it. Could anyone from the dev team please confirm what is the official way to turn off cookie storage in database?

Thanks!

Paul Miller

unread,
Feb 1, 2018, 2:03:58 PM2/1/18
to satishkumar...@gmail.com, android-webview-dev

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
To post to this group, send email to android-webview-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/7d0810b1-c876-4cf1-a1ca-4f5f60c3a27d%40chromium.org.

satishkumar...@gmail.com

unread,
Feb 2, 2018, 8:43:22 AM2/2/18
to android-webview-dev, satishkumar...@gmail.com, paulm...@google.com
Hi Paul,

My requirement is that cookies should be accepted and sent by WebView just by maintaining an in-memory cookie store. Just that it should not be stored in a persistent storage like db. As per my understanding, the API mentioned by you will completely disable sending and accepting of cookies by WebView. Could you please confirm if my requirement will be addressed by the API you mentioned? If not, could you please tell me if WebView supports this currently?


On Friday, February 2, 2018 at 12:33:58 AM UTC+5:30, Paul Miller wrote:
On Thu, Feb 1, 2018 at 7:25 AM, <satishkumar...@gmail.com> wrote:
Hi,

Is it possible to turn off cookie storage in database? I tried calling https://developer.android.com/reference/android/webkit/WebSettings.html#setDatabaseEnabled(boolean) with false. But, I could still see the "Cookies" database having the values in Android 5.1 emulator. But, in Android 7.0 emulator, "Cookies" database file is present, but no tables are present inside it. Could anyone from the dev team please confirm what is the official way to turn off cookie storage in database?

Thanks!

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
To post to this group, send email to android-w...@chromium.org.

Torne (Richard Coles)

unread,
Feb 2, 2018, 11:02:27 AM2/2/18
to satishkumar...@gmail.com, android-webview-dev, paulm...@google.com
No, there's no way to do this, and you would likely find that the result would be confusing and unpredictable to users of your app. Since the lifetime of a process on Android is variable and controlled by the system, not by your app, every time the user switched away from your app to do something else and came back it would be effectively random whether or not the cookies still existed or not, which would probably be confusing.

On Fri, 2 Feb 2018 at 08:43 <satishkumar...@gmail.com> wrote:
Hi Paul,

My requirement is that cookies should be accepted and sent by WebView just by maintaining an in-memory cookie store. Just that it should not be stored in a persistent storage like db. As per my understanding, the API mentioned by you will completely disable sending and accepting of cookies by WebView. Could you please confirm if my requirement will be addressed by the API you mentioned? If not, could you please tell me if WebView supports this currently?


On Friday, February 2, 2018 at 12:33:58 AM UTC+5:30, Paul Miller wrote:
On Thu, Feb 1, 2018 at 7:25 AM, <satishkumar...@gmail.com> wrote:
Hi,

Is it possible to turn off cookie storage in database? I tried calling https://developer.android.com/reference/android/webkit/WebSettings.html#setDatabaseEnabled(boolean) with false. But, I could still see the "Cookies" database having the values in Android 5.1 emulator. But, in Android 7.0 emulator, "Cookies" database file is present, but no tables are present inside it. Could anyone from the dev team please confirm what is the official way to turn off cookie storage in database?

Thanks!

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.

To post to this group, send email to android-w...@chromium.org.

satishkumar...@gmail.com

unread,
Feb 5, 2018, 4:52:35 AM2/5/18
to android-webview-dev, satishkumar...@gmail.com, paulm...@google.com
Hi Richard,

Thanks a lot for the confirmation!

On Friday, February 2, 2018 at 9:32:27 PM UTC+5:30, Richard Coles wrote:
No, there's no way to do this, and you would likely find that the result would be confusing and unpredictable to users of your app. Since the lifetime of a process on Android is variable and controlled by the system, not by your app, every time the user switched away from your app to do something else and came back it would be effectively random whether or not the cookies still existed or not, which would probably be confusing.

On Fri, 2 Feb 2018 at 08:43 <satishkumar...@gmail.com> wrote:
Hi Paul,

My requirement is that cookies should be accepted and sent by WebView just by maintaining an in-memory cookie store. Just that it should not be stored in a persistent storage like db. As per my understanding, the API mentioned by you will completely disable sending and accepting of cookies by WebView. Could you please confirm if my requirement will be addressed by the API you mentioned? If not, could you please tell me if WebView supports this currently?


On Friday, February 2, 2018 at 12:33:58 AM UTC+5:30, Paul Miller wrote:
On Thu, Feb 1, 2018 at 7:25 AM, <satishkumar...@gmail.com> wrote:
Hi,

Is it possible to turn off cookie storage in database? I tried calling https://developer.android.com/reference/android/webkit/WebSettings.html#setDatabaseEnabled(boolean) with false. But, I could still see the "Cookies" database having the values in Android 5.1 emulator. But, in Android 7.0 emulator, "Cookies" database file is present, but no tables are present inside it. Could anyone from the dev team please confirm what is the official way to turn off cookie storage in database?

Thanks!

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
To post to this group, send email to android-w...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
Reply all
Reply to author
Forward
0 new messages