diff --git a/spring-session/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java b/spring-session/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java index ce47ec0c..a6427b25 100644 --- a/spring-session/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java +++ b/spring-session/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java @@ -93,6 +93,8 @@ public class SessionRepositoryFilter public static final String INVALID_SESSION_ID_ATTR = SESSION_REPOSITORY_ATTR + ".invalidSessionId"; + private static final String CURRENT_SESSION_ATTR = "org.springframework.session.web.http.CURRENT_SESSION"; // compile-time constant. + /** * The default filter order. */ @@ -213,8 +215,6 @@ public class SessionRepositoryFilter */ private final class SessionRepositoryRequestWrapper extends HttpServletRequestWrapper { - private final String CURRENT_SESSION_ATTR = HttpServletRequestWrapper.class - .getName(); private Boolean requestedSessionIdValid; private boolean requestedSessionInvalidated; private final HttpServletResponse response; @@ -252,15 +252,15 @@ public class SessionRepositoryFilter @SuppressWarnings("unchecked") private HttpSessionWrapper getCurrentSession() { - return (HttpSessionWrapper) getAttribute(this.CURRENT_SESSION_ATTR); + return (HttpSessionWrapper) getAttribute(CURRENT_SESSION_ATTR); } private void setCurrentSession(HttpSessionWrapper currentSession) { if (currentSession == null) { - removeAttribute(this.CURRENT_SESSION_ATTR); + removeAttribute(CURRENT_SESSION_ATTR); } else { - setAttribute(this.CURRENT_SESSION_ATTR, currentSession); + setAttribute(CURRENT_SESSION_ATTR, currentSession); } }