fryette / webview_cookie_manager

MIT License
48 stars 52 forks source link

Ignore invalid cookies when getting cookies #48

Closed dtyoung closed 3 years ago

dtyoung commented 3 years ago

When calling getCookies(), all cookies for the provided url are serialised. There is a possibility that a cookie's value could contain invalid characters. If this is the case, a FormatException is thrown during the creation of the Cookie object, resulting in no cookies being serialised. This is particularly annoying if the desired result of calling getCookies() is to fetch information about a particular cookie.

This commit handles serialisation of cookies with invalid values by catching any cookies with invalid values and removing them from the returned list of cookies.