关于CloseableHttpClient 和 HttpURLConnection 中的 cookie问题

我在请求需要登录的链接时发生的问题。。。

1、**用CloseableHttpClient** 请求
返回:
{"error_no":102,"error_msg":"user not login","result":null}...

2、**用HttpURLConnection** 请求
返回:
resp >>> {"error_no":40004,"error_msg":"\u9886\u53d6\u5931\u...
说明已经登录了,是我想要的结果

同样的url,同样的cookie,为什么用CloseableHttpClient是未登录?

下面分别是两个请求方法的代码:
图片说明
图片说明

CloseableHttpClient 的cookie应该设置在head?