HttpSession rawSession = request.getSession();
Map sessionData = loadSessionData(sessionId, rawSession);
try {
HttpSession sessionWrapper = new HttpSessionSessionStoreWrapper(rawSession,
sessionStore,sessionId,sessionData);
chain.doFilter(new HttpServletRequestSessionWrapper(request,sessionWrapper), response);
}finally {
try {
sessionStore.saveSession(sessionId, sessionData,rawSession.getMaxInactiveInterval());