`$cookies.put()` Takes 30 Seconds To Save The Cookie On Disk On Android
Solution 1:
I had the same problem and made a small plugin (still work in progress) to fix that.
It exposes the flush method, which will apply your cookie modifications (put and remove) to persistent memory.
link to cordova-plugin-cookie-manager
Feel free to contribute.
Solution 2:
The CookieManager design in the android makes it difficult to implement.
The webview
and the cookiemanager
which contain their own in_memory
databases and are in sync to one another hence there is no need to sync the two of them.
The removeSessionCookie
doesn't provide a callback or any way for it to complete and since this method has been implemented in the WebView
classic versions.
Here are some solutions in which you can sync up between HttpUrlCookieManager
and the android webkit cookie manager
Another thing to note here is when you use $cookie.put()
it defines the cookies
to be sent along with the rest of the HTTP headers to the client but if you use the third party api's
to get the cookies
it may not contain cookies only from the client
anymore which may result in unwanted side effects.
You may refer to the link here as suggested by Author to this post - author' post and here is the link for the protocols to be used while defining the cookies link here
Here is another link that i stumbled upon which may help a bit
or to use the same repository/database of the webview
and the HttpUrlConnection
you can create your own handler as implemented in the following stack thread Stack thread
Hope it may help you a bit.
Post a Comment for "`$cookies.put()` Takes 30 Seconds To Save The Cookie On Disk On Android"