assertTrue(sessionCookie != null);
// Mangle the cookie, replacing Path with $Path, etc.
sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path=");
//do another request to change the session attribute
Request request = client.newRequest("http://localhost:" + port + "/mod/test?action=setA");
request.header("Cookie", sessionCookie);
response = request.send();
assertEquals(HttpServletResponse.SC_OK,response.getStatus());
A_VALUE.assertPassivatesEquals(1);
A_VALUE.assertActivatesEquals(1);
A_VALUE.assertBindsEquals(1);
A_VALUE.assertUnbindsEquals(0);
//do another request using the cookie to try changing the session attribute to the same value again
request= client.newRequest("http://localhost:" + port + "/mod/test?action=setA");
request.header("Cookie", sessionCookie);
response = request.send();
assertEquals(HttpServletResponse.SC_OK,response.getStatus());
A_VALUE.assertPassivatesEquals(2);
A_VALUE.assertActivatesEquals(2);
A_VALUE.assertBindsEquals(1);
A_VALUE.assertUnbindsEquals(0);
//do another request using the cookie and change to a different value
request= client.newRequest("http://localhost:" + port + "/mod/test?action=setB");
request.header("Cookie", sessionCookie);
response = request.send();
assertEquals(HttpServletResponse.SC_OK,response.getStatus());
B_VALUE.assertPassivatesEquals(1);
B_VALUE.assertActivatesEquals(1);
B_VALUE.assertBindsEquals(1);
B_VALUE.assertUnbindsEquals(0);