问题
Set-Cookie: oauth=xyz; domain=tyxbv; path=/; expires=Tue, 27-Oct-2020 17:16:00 GMT; secure; HttpOnly
This is the cookie which i am getting from server when my webivew hits the url. But when I try to get the cookie details from the webview using getCookie("url which sets the cookie") i get
oauth = xyz
The other cookie attributes are not stored in the cookie store. I am unable to solve the above. I need other attributes also like path, expires. etc I am setting accept third party cookies true and accept cookies true. Though i have gone through this - https://medium.com/@ericluapp/something-might-be-confused-about-cookiemanager-setcookie-422e6e28aacf but here the issue is cookie is sent by the server and set by the server in the webview cookie manager. The blog says to override it and store it according to my own k1 k2 k3.
I want to add one more insight when I try to check cookies through chrome dev tools-> application->storage->cookies I can see the whole cookie attributes expiry, domain, path. Now figuring out how i can see the same programmatically using cookiemanager or any other webview class.
来源:https://stackoverflow.com/questions/59611761/android-webview-webkit-cookiemanager-neglecting-cookie-attributes-like-expire