title: how to get cookies from volley response
body: <p>I need to get the cookies from server response. For network calling i am using volley library.</p>
  
  <pre><code>getRequest(String url, Response.Listener&lt;JSONObject&gt; responseListener, Response.ErrorListener errorListener) {
          try {
  
              JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, url, null, responseListener
                      , errorListener) {
                  @Override
                  public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
                      return getAuthHeader(context);
                  }
              };
              RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
              req.setRetryPolicy(policy);
              req.setShouldCache(false);
              addToRequestQueue(req);
          } catch (Exception e) {
              e.printStackTrace();
          }
  
  public static Map&lt;String, String&gt; getAuthHeader(Context context) {
          Map&lt;String, String&gt; headerMap = new HashMap&lt;&gt;();
  
          headerMap.put("token", auth);     
          headerMap.put("Api-key", API_KEY);
          headerMap.put("Content-Type", CONTENT_TYPE);
  
          return headerMap;
      }
  </code></pre>