I found the solution :
get the cookie of the response of your login and set it on the next request the cookie content would look like this :
PHPSESSID=sqv184d99ndodebh4te9lmpji5; path=/
and this is the code :
MimeHeaders session = response.getMimeHeaders();
String []cookies = session.getHeader("Set-Cookie");
request.getMimeHeaders().addHeader("Cookie", cookies[0]);