Class WebkitCookieJar
-
- All Implemented Interfaces:
-
okhttp3.CookieJar
public final class WebkitCookieJar implements CookieJarManages the cookies when making http request with the okhttp3.OkHttpClient instance saved in com.sap.cloud.mobile.foundation.common.ClientProvider.
It implements the interface of CookieJar in the okhttp3 library and uses CookieManager to store and retrieve the cookies.
When using android.webkit.WebView to authenticate the user, because android.webkit.WebView is also using CookieManager for cookie management, the cookies belong to different domains will all be saved in CookieManager, so please be careful when using the APIs like 'removeAllCookies' and 'removeSessionCookies' of CookieManager since they will also remove the session cookies of the IDP. If the IDP has more strict user session management, the above APIs might lead to IDP login failure and the user has to wait for the IDP session expires.
To safely removing the session cookies, please use com.sap.cloud.mobile.foundation.user.UserService.logoutUser, it will logout the IDP then remove all the cookies.
-
-
Constructor Summary
Constructors Constructor Description WebkitCookieJar()
-
Method Summary
Modifier and Type Method Description List<Cookie>loadForRequest(HttpUrl url)UnitsaveFromResponse(HttpUrl url, List<Cookie> cookies)-
-
Method Detail
-
loadForRequest
List<Cookie> loadForRequest(HttpUrl url)
-
saveFromResponse
Unit saveFromResponse(HttpUrl url, List<Cookie> cookies)
-
-
-
-