F
F
Fedor Kolov2014-10-23 10:29:52
Java
Fedor Kolov, 2014-10-23 10:29:52

How to get all cookies in HttpState?

There was a problem in getting all cookies from httpclient. I send a request, I get Set-Cookie headers. There are 3 of them. Two pass the test, the third does not. But in the client settings it says:
CookiePolicy.BROWSER_COMPATIBILITY
And the log says that all three of them are accepted by the client:
Cookie accepted: ***
But when I write this code to get it:
Cookie[] cookies1 = httpclient.getState().getCookies() ;
He stubbornly writes to me that there are only 2 of them. What else did you miss?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fedor Kolov, 2014-10-27
@d_f

The value of this cookie was "fixcookie" and apparently for this reason it did not want to be accepted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question