Package org.springframework.security.web.server.authentication

# Interface SessionLimit

All Superinterfaces:
  `Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Integer>>`

public interface SessionLimit extends Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Integer>>
Represents the maximum number of sessions allowed. Use `UNLIMITED` to indicate that there is no limit.

Since:
  6.3
See Also:
  - `ConcurrentSessionControlServerAuthenticationSuccessHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final SessionLimit`
`UNLIMITED`
Represents unlimited sessions.

## Method Summary

Static Methods
Modifier and Type
Method
Description
`static SessionLimit`
`of(int maxSessions)`
Creates a `SessionLimit` that always returns the given value for any user

### Methods inherited from interface java.util.function.Function

`andThen, apply, compose`

## Field Details

### UNLIMITED

static final SessionLimit UNLIMITED
Represents unlimited sessions. This is just a shortcut to return `Mono.empty()` for any user.

## Method Details

### of

static SessionLimit of(int maxSessions)
Creates a `SessionLimit` that always returns the given value for any user

Parameters:
  `maxSessions` - the maximum number of sessions allowed
Returns:
  a `SessionLimit` instance that returns the given value.