Where are the cookies in the native android browse

2020-07-13 11:02发布

Basically, I'd like to know if there's a specific folder I can look in and copy/paste cookie data from. I've tried looking around myself but to no avail. Google didn't help much either.

If they aren't stored to a folder that is directly accessible, is there any other way to get to them?

I'm on the Android 2.2 (Froyo) version if that helps. THANKS. :D

3条回答
家丑人穷心不美
2楼-- · 2020-07-13 11:35

For security reasons, each application stores its data in a private sandbox/folder and other applications cannot access it. Refer Cookie Management details in Webview http://developer.android.com/reference/android/webkit/WebView.html

查看更多
Luminary・发光体
3楼-- · 2020-07-13 11:35

If you are using a WebView within an application to show the page in question you can find the cookies in the db file:

/data/data/your.apps.package.name/databases/webview.db

Once you've got that db you can do the same thing from Mike's answer to inspect the cookies.

select * from cookies
查看更多
We Are One
4楼-- · 2020-07-13 11:45

We ran into a particular scenario where we wanted to see how our website cookies were re-acting with a device. We were able to view the database the cookies are stored using "adb shell" on an emulated device. After running the shell, we were able to track the cookies to a database using the following command.

sqlite3 /data/data/com.android.browser/databases/webviewCookiesChromium.db

and the select statement here:

select * from cookies;

the column list can be view by using the following command:

pragma table_info(cookies);
查看更多
登录 后发表回答