title: Jersey - cookie set on a client does not arrive to the server
body: <p>I am writing a client application with jersey java libraries, I am not succesfull in sending cookies to the server. Where is my mistake? Here is my code:</p>
  
  <p>CLIENT:</p>
  
  <pre><code>    Client client = ClientBuilder.newClient();
  
      WebTarget webTarget = client.target(getUrl());  
  
      //Create invocation builder
      Invocation.Builder invocationBuilder = webTarget.request(getMime_type());
  
      //Set the cooky
  
      invocationBuilder = invocationBuilder.cookie("mioCookie","value of my cookie");
  
      Response response = invocationBuilder.get();
  </code></pre>
  
  <p>SERVER:</p>
  
  <pre><code>@Path("/file")
  public class FileService {
      Logger LOG=Logger.getLogger(this.getClass().getName());
      private static final String FILE_PATH = "file.log";
  
      @GET
      @Path("/get")
      @Produces("text/plain")
      public Response getFile(@CookieParam(value = "mioCookie") String mioCookie) {
          LOG.info("***** Cookie in input: " + mioCookie);
          File file = new File(FILE_PATH);
          NewCookie modifiedCookie = new NewCookie("mioCookie", mioCookie + "- modified");
          ResponseBuilder response = Response.ok((Object) file);
          response.header("Content-Disposition",  "attachment; filename=\"file_from_server.log\"");
          response.cookie(modifiedCookie);
          return response.build();
  
      }
  </code></pre>
  
  <p>what is written by the log is:</p>
  
  <pre><code>infos: ***** Cookie in input: null.
  </code></pre>
  
  <p>Where am I wrong? </p>