You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using this library with OkHttp3 in 2 separate activities.
In the first activity, we are logging in via a POST, and then starting the second activity.
Once there, we request some information to the same server via a GET call (this is a secured endpoint).
This second call is failing saying the request is not authorized.
This system has been on production for years, so we know it's not the issue.
It looks like either the cookies are not being saved on the initial POST response, or sent out on the GET call. I was under the impression they are saved and sent out by this library, is there something extra that needs to be done?
Here's how we're setting up the client (in both activites):
// Have also tried ClearableCookieJar instead of CookieJar
CookieJar cookieJar =
new PersistentCookieJar(new SetCookieCache(), new SharedPrefsCookiePersistor(this));
OkHttpClient client = new OkHttpClient.Builder()
.cookieJar(cookieJar)
.build();
The text was updated successfully, but these errors were encountered:
ExciteM-Blog
changed the title
Cookies are either not persisting, or being sent out
Cookies are either not persisting, or not being sent out
Sep 8, 2018
Hi,
We are using this library with OkHttp3 in 2 separate activities.
In the first activity, we are logging in via a POST, and then starting the second activity.
Once there, we request some information to the same server via a GET call (this is a secured endpoint).
This second call is failing saying the request is not authorized.
This system has been on production for years, so we know it's not the issue.
It looks like either the cookies are not being saved on the initial POST response, or sent out on the GET call. I was under the impression they are saved and sent out by this library, is there something extra that needs to be done?
Here's how we're setting up the client (in both activites):
The text was updated successfully, but these errors were encountered: