title: How to keep session using Retrofit OkHttpClient
body: <p>With the DefaultHttpClient() you could do </p>
  
  <pre><code>HttpClient client = new DefaultHttpClient();
  HttpGet request = new HttpGet(url_login.toURI());
  HttpGet request1 = new HttpGet(url_getList.toURI());
  HttpGet request2 = new HttpGet(url.getOtherList.toURI());
  HttpResponse response = client.execute(request);
  HttpResponse response1 = client.execute(request1);
  HttpResponse response2 = client.execute(request2);
  </code></pre>
  
  <p>and the client would keep the session, how do I manage the following with retrofit 2</p>
  
  <pre><code>HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
              interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
  
              OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new Interceptor() {
                  @Override
                  public Response intercept(Chain chain) throws IOException {
                      Request original = chain.request();
  
                      // Customize the request
                      Request request = original.newBuilder()
                              .header("Accept", "application/json")
                              .header("Authorization", "auth-token")
                              .method(original.method(), original.body())
                              .build();
  
                      Response response = chain.proceed(request);
  
                      // Customize or return the response
                      return response;
                  }
              }).build();
  
              Retrofit.Builder builder = new Retrofit.Builder()
                              .baseUrl(BASE_URL)
                              .addConverterFactory(GsonConverterFactory.create());
  
              Retrofit rt = builder.client(client).build();
              RestAPI restAPI = rt.create(RestAPI.class);
              ....
              callLogin = restAPI.login();
              Call&lt;Model&gt; callModel = restAPI.getModel();
  </code></pre>
  
  <p>2 restApi call doesn´t work restApi client is not logged in</p>