title: How to prevent Retrofit from clearing my cookies
body: <p>I get a cookie from my backend API that allows me to authenticate all subsequent user requests.
  I'm using retrofit, and I can't get it to keep the session key between requests. I want to know how to configure retrofit so that it keeps the session key around and uses it for all future requests:</p>
  <pre><code>public class ApiClient{
  
      private static final String API_URL = &quot;http://192.168.1.25:8080&quot;;
  
      private static RestAppApiInterface sRestAppService;
  
      public static RestAppApiInterface getRestAppApiClient() {
          if (sRestAppService == null) {
  
              CookieManager cookieManager = new CookieManager();
              cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
              CookieHandler.setDefault(cookieManager);
  
              RestAdapter restAdapter = new RestAdapter.Builder()
                      .setEndpoint(API_URL)
                      .build();
              sRestAppService = restAdapter.create(RestAppApiInterface.class);
          }
          return sRestAppService;
      }
  
  }
  </code></pre>