Semo Semo - 10 days ago 5
PHP Question

Are cookies used to request image sources in android webview?

I am using an android

WebView
to load a company page which requires a certain cookie.

Part of this page are several images which are generated via PHP script. This script is on the same site and also requires the same cookie.
I use the CookieSyncManager and CookieManager but I don't know how to prove that the correct cookies are used.

My problem is that the pictures are not shown. When I try to access the pictures separately I get a redirect to the login page ( which is standard for not authenticated requests )

Any ideas?

Answer

If you try on Android 4.4, you can use Dev Tools to inspect the network requests and check for the cookie. Prior to 4.4, you could try using tcpdump/wireshark to look at the requests. Alternatively, can you have the server log the cookies that are sent with the request and inspect them that way?

Comments