Another benefit of concurrent session control is that SessionRegistry exists to track active (and, optionally, expired) sessions. This means that we can get runtime information about what user activity exists in our system (for authenticated users, at least) by performing the following steps:
- You can even do this if you don't want to enable concurrent session control. Simply set maximumSessions to -1, and session tracking will remain enabled, even though no maximum will be enforced. Instead, we will use the explicit bean configuration provided in the SessionConfig.java file of this chapter, as follows:
//src/main/java/com/packtpub/springsecurity/configuration/
SessionConfig.java
@Bean
public SessionRegistry sessionRegistry(){
return new SessionRegistryImpl();
}
- We have already added...