@Test
  public void testRegionInvalidate() throws Exception {
    String key = "value_testRegionInvalidate";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Set an attribute
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    WebResponse response = wc.getResponse(req);
    String sessionId = response.getNewCookieValue("JSESSIONID");

    // Invalidate the session
    req.removeParameter("param");
    req.removeParameter("value");
    req.setParameter("cmd", QueryCommand.INVALIDATE.name());

    wc.getResponse(req);
    assertThat(region.get(sessionId)).as("The region should not have an entry for this session")
        .isNull();
  }
Test that a session attribute gets removed from the region when the session is invalidated.
extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/TestSessionsTomcat8Base.java