Comments (3)
The problem here is that the cookies returned shouldn't be null, so making the null check would be a workaround but will not solve the problem. I will try to reproduce the issue and see why the null cookies are appearing, if you have any fixed steps to reproduce the issue it will be appreciated.
from persistentcookiejar.
I can reproduce the error though it's a very edge case.
The problem was because I was using the previous version of the library w/ okhttp2 which serialized SerializedHttpCookie
under the old class.
When upgrading to okhttp3 with this library, since I'm using the same SharedPreference
, it's still taking the byte data of the old Cookie and tried to serialize it to the new SerializableCookie
.
It throws ClassNotFoundException
and returns null during SerializableCookie.decode()
This error might also happen if someone use the same SharedPreference
for their cookie and data.
IMO, null check is still required since the code SerializableCookie.decode
might return null.
Either that, or throw a RuntimeException
which clearly indicates why the deserialization has failed.
from persistentcookiejar.
Null check merged, thanks for your contribution
from persistentcookiejar.
Related Issues (20)
- When i get cookies Access the server ,sometime cookies is null ,
- Error:Cannot change dependencies of configuration ':app:_debugAnnotationProcessor' after it has been resolved.
- How to read cookies? HOT 2
- Proguard rules doesn't make sense?
- How to remove cookies for a target url? HOT 1
- Repo is unavailable HOT 4
- SetCookieCache may lead to ConcurrentModificationException HOT 1
- May I ask you something
- Invalid Cast HOT 3
- could not use chinese as login name (不能使用中文的登录名)
- Kill the process from the background, from the new entry NullPointerException error HOT 1
- Cookies are either not persisting, or not being sent out HOT 1
- Failed to resolve: com.github.franmontiel:PersistentCookieJar:v1.0.1 HOT 2
- If only there were .jar
- Google play rejected my app
- Issue with implementation of the Secure flag in cookies
- Share cookie with Webview HOT 2
- work with Glide
- Why are the results obtained cookie.value() = deleteMe ?
- Check if Cookie exists before making a network call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from persistentcookiejar.