Android webview( webkit.CookieManager) neglecting cookie attributes like ;expires

拈花ヽ惹草 提交于 2020-01-14 05:24:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!