Hi,
I wanted to get cookies from WKWebview.
First i tried to use the suggested method for normal WebViews
but the return was Null.
I also tried to get the cookies using js ("document.cookie"), but the returned cookies, were only a portion, due to HttpOnly restrictions.
Is there any possible way to get all the cookies from a WKWebview?
I wanted to get cookies from WKWebview.
First i tried to use the suggested method for normal WebViews
B4X:
Sub WebView1_PageFinished (Success As Boolean, Url As String)
Dim no As NativeObject
Dim cookies As List = no.Initialize("NSHTTPCookieStorage").RunMethod("sharedHTTPCookieStorage", Null).RunMethod("cookies", Null)
For Each cookie As NativeObject In cookies
Log($"Name: ${cookie.GetField("name")}, value: ${cookie.GetField("value")}"$)
Next
End Sub
but the return was Null.
I also tried to get the cookies using js ("document.cookie"), but the returned cookies, were only a portion, due to HttpOnly restrictions.
Is there any possible way to get all the cookies from a WKWebview?
Last edited: