Class WebkitCookieJar

  • All Implemented Interfaces:
    okhttp3.CookieJar

    
    public final class WebkitCookieJar
     implements CookieJar
                        

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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      List<Cookie> loadForRequest(HttpUrl url)
      Unit saveFromResponse(HttpUrl url, List<Cookie> cookies)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebkitCookieJar

        WebkitCookieJar()