title: Include cookies in HTTP requests when using the Google Cloud Endpoints JavaScript client
body: <p>I am currently making API calls to my backend using the Google Cloud Endpoint generated JavaScript Client. The problem is the cookies for my page are not being added to the HTTP requests. How can I add the Gitkit gtoken cookie to my request.</p>
  
  <ul>
  <li>Backend is Google App Engine Java</li>
  <li>Using Goole Cloud Endpoints to build my API</li>
  <li>Using the Google Cloud Endpoints JavaScript web client loaded as follows <code>gapi.client.load('myApi', 'v1', resourceLoaded, 'https://my-project-id.appspot.com/_ah/api');</code></li>
  </ul>
  
  <p>I have already configured Google Cloud Endpoints, on the backend, to allow cookies. <code>auth = @ApiAuth(allowCookieAuth = AnnotationBoolean.TRUE)</code></p>
  
  <p>My endpoint looks as follows.</p>
  
  <pre><code>@ApiMethod(path = "user-account")
  public UserAccount get(HttpServletRequest httpRequest) {
  
      GitkitUser gitkitUser = Gitkit.validate(httpRequest); // returns null
  
      Cookie[] cookies = httpRequest.getCookies();
      log.severe("# of cookies: " + cookies.length);
      for (Cookie cookie : cookies) {
         log.severe("cookie name: " + cookie.getName());
          log.severe("cookie value: " + cookie.getValue()); 
      }
  
      /*
       * Logs 1 for # of cookies, with a cookie name of "G_ENABLED_IDPS" 
       * a value of "google". No gtoken cookie, even though I have 
       * checked and there is one!
       */
  
      ...
  
  }
  </code></pre>
  
  <p>I am making calls with the Google Cloud Endpoints JS client as so.</p>
  
  <pre><code>gapi.client.myApi.userAccountResource.get().execute(function (resp){
      ...
  });
  </code></pre>
  
  <p><strong>Is there something I have to do to make sure the Endpoints JS client includes the gtoken cookie in it's request?</strong></p>