Reputation: 37098
To use
@Autovired
SessionRegistry sessionRegistry
in my code I have added following configuration:
http.sessionManagement()
.maximumSessions(1)
.sessionRegistry(sessionRegistry());
But I don't want to limit maximum sessions.
Can I achieve it?
Upvotes: 2
Views: 225
Reputation: 37098
-1
- special value to say spring don't limit user sessions
http.sessionManagement()
.maximumSessions(-1)
.sessionRegistry(sessionRegistry());
Upvotes: 1
Reputation: 103
Add this to enable multiple logins of same user with different sessions but invalidates the old session with the start of the new.
http.sessionManagement()
.maximumSessions(1)
.sessionRegistry(sessionRegistry()).and().enableSessionUrlRewriting(false)
.sessionFixation().newSession()
Upvotes: 0