@Bean public ConcurrentSessionControlStrategy concurrentSessionControlStrategy(){ ConcurrentSessionControlStrategy bean = new ConcurrentSessionControlStrategy(cojSessionRegistryImpl); bean.setMaximumSessions(3); bean.setExceptionIfMaximumExceeded(true); return bean; }