Hi Sergey

Yes, this helps. Thank you!

Here is the code to extract the JSESSIONID value:

// get all cookies
List cookies = this.client.getResponse().getMetadata().get("Set-Cookie");
                
if (cookies != null && !cookies.isEmpty()) {
                        
  String cookie;
  for (Object object : cookies) {
    cookie = (String) object;
    if (cookie.contains("JSESSIONID")) {
      // cookie looks like that: JSESSIONID=m4i8fbdufhiy12tlnpd1hfp3f;Path=/
      cookie = cookie.substring(cookie.indexOf("=") + 1,
cookie.indexOf(";"));
    }
  }
}

Cheers!
Mike
-- 
View this message in context: 
http://cxf.547215.n5.nabble.com/How-to-read-Cookies-in-CXF-Client-tp3310363p3313165.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to