@ -59,6 +63,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -59,6 +63,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@ -108,7 +113,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -108,7 +113,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@ -128,7 +133,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -128,7 +133,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
// Session exists, so try to obtain a context from it.
@ -141,7 +146,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -141,7 +146,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
// We now have the security context object from the session.
logger.warn("SPRING_SECURITY_CONTEXT did not contain a SecurityContext but contained: '"
logger.warn(springSecurityContextKey+" did not contain a SecurityContext but contained: '"
+contextFromSession+"'; are you improperly modifying the HttpSession directly "
+"(you should always use SecurityContextHolder) or using the HttpSession attribute "
+"reserved for this class?");
@ -151,7 +156,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -151,7 +156,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
}
if(debug){
logger.debug("Obtained a valid SecurityContext from SPRING_SECURITY_CONTEXT: '"+contextFromSession+"'");
logger.debug("Obtained a valid SecurityContext from "+springSecurityContextKey+": '"+contextFromSession+"'");
}
// Everything OK. The only non-null return from this method.
@ -212,6 +217,17 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -212,6 +217,17 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@ -273,7 +289,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -273,7 +289,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
if(httpSession!=null){
// SEC-1587 A non-anonymous context may still be in the session
@ -286,8 +302,8 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
@@ -286,8 +302,8 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
// actually changed in this thread (see SEC-37, SEC-1307, SEC-1528)
if(httpSession!=null){
// We may have a new session, so check also whether the context attribute is set SEC-1561
@ -39,9 +41,23 @@ public class HttpSessionDestroyedEvent extends SessionDestroyedEvent {
@@ -39,9 +41,23 @@ public class HttpSessionDestroyedEvent extends SessionDestroyedEvent {
@ -113,33 +114,35 @@ public class HttpSessionSecurityContextRepositoryTests {
@@ -113,33 +114,35 @@ public class HttpSessionSecurityContextRepositoryTests {
@ -188,15 +191,16 @@ public class HttpSessionSecurityContextRepositoryTests {
@@ -188,15 +191,16 @@ public class HttpSessionSecurityContextRepositoryTests {