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.
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.