public void commitSession(HttpServletResponse response) {
PippoHttpSession wrappedSession = currentSession;
if (wrappedSession == null) {
if (isInvalidateClientSession()) {
getSessionStrategy().onInvalidatedSession(this, response);
}
} else {
SessionData sessionData = wrappedSession.getSessionData();
getSessionDataStorage().save(sessionData);
if (!isRequestedSessionIdValid() || !sessionData.getId().equals(getRequestedSessionId())) {
getSessionStrategy().onNewSession(this, response, sessionData);
}
}
}