// Perform a request to contextA
ContentExchange exchangeA = new ContentExchange(true);
exchangeA.setMethod(HttpMethods.GET);
exchangeA.setURL("http://localhost:" + port + contextA + servletMapping);
client.send(exchangeA);
exchangeA.waitForDone();
assert exchangeA.getResponseStatus() == HttpServletResponse.SC_OK;
String sessionCookie = exchangeA.getResponseFields().getStringField("Set-Cookie");
assert sessionCookie != null;
// Mangle the cookie, replacing Path with $Path, etc.
sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path=");