@Test
  public void testAttributesUpdatedInRegion() throws Exception {
    Callback c_1 = (request, response) -> request.getSession().setAttribute("foo", "bar");

    // This is the callback used to invalidate the session
    Callback c_2 = (request, response) -> request.getSession().setAttribute("foo", "baz");

    tester.setAttribute("callback_1", c_1);
    tester.setAttribute("callback_2", c_2);

    servletHolder.setInitParameter("test.callback", "callback_1");

    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
    sh2.setInitParameter("test.callback", "callback_2");

    tester.start();

    request.setMethod("GET");
    request.setURI("/test/hello");
    request.setHeader("Host", "tester");
    request.setVersion("HTTP/1.0");
    response = HttpTester.parseResponse(tester.getResponses(request.generate()));

    List<Cookie> cookies = getCookies(response);

    Region r = getRegion();
    assertEquals("bar",
        ((HttpSession) r.get(getSessionCookie(cookies).getValue())).getAttribute("foo"));

    request.setHeader("Cookie", "JSESSIONID=" + getSessionCookie(cookies).getValue());
    request.setURI("/test/request2");
    response = HttpTester.parseResponse(tester.getResponses(request.generate()));

    assertEquals("baz",
        ((HttpSession) r.get(getSessionCookie(cookies).getValue())).getAttribute("foo"));
  }
Test that attributes are updated on the backend
extensions/geode-modules-session/src/integrationTest/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java