How to handle Cookies with Apache HttpClient 4.3 How to handle Cookies with Apache HttpClient 4.3 curl curl

How to handle Cookies with Apache HttpClient 4.3


Your code looks OK to me (other than not releasing resources, but I presume exception handling was omitted for brevity). The reason for cookie store being empty may be violation of the actual cookie policy (which is BEST_MATCH in your case) by the target server. So, cookies sent by the server get rejected as invalid. You can find out if that is the case (and other useful contextual details) by turning on context / wire logging as described here