OpenAM lets you limit the number of active sessions for a user by setting session quotas. You also configure session quota exhaustion actions so that when a user goes beyond the session quota, OpenAM takes the appropriate action.
![]() |
Important |
|---|---|
|
To enforce session quotas across multiple servers in a site, configure session failover as described in the Installation Guide chapter, Setting Up OpenAM Session Failover. |
Procedure 2.3. To Configure Session Quotas & Exhaustion Actions
The session quota applies to all sessions opened for the same user (as represented by the user's universal identifier).
-
Log in to OpenAM Console as administrator, and then browse to Configuration > Global > Session.
-
Set Enable Quota Constraints to
ON. -
Set Resulting behavior if session quota exhausted.
The following settings are available by default.
DENY_ACCESS-
Deny access, preventing the user from creating an additional session.
DESTROY_NEXT_EXPIRING-
Remove the next session to expire, and create a new session for the user. The next session to expire is the session with the minimum time left until expiration.
This is the default setting.
DESTROY_OLDEST_SESSION-
Remove the oldest session, and create a new session for the user.
DESTROY_OLD_SESSIONS-
Remove all existing sessions, and create a new session for the user.
If none of these session quota exhaustion actions fit your deployment, you can implement a custom session quota exhaustion action. See the Developer's Guide chapter on Customizing Session Quota Exhaustion Actions for an example.
-
Set Active User Sessions to the session quota.
The default is 5 sessions.
-
Save your work.
-
If you have multiple servers but session failover is not configured, configure multi-server mode as described below.
-
If you have only a single OpenAM server, skip this step. OpenAM enforces the session quota you set for the server.
-
If you have multiple servers with session failover configured, then also skip this step. In this case OpenAM uses the session store to enforce session quotas globally across your deployment. In other words when the Set Active User Sessions is 5, a user can have a maximum of 5 active sessions.
-
If you have multiple OpenAM servers but session failover is not configured, configure multi-server mode for session quotas. Browse to Configuration > Servers and Sites > Default Server Settings or Configuration > Servers and Sites >
Server Name, and then use the Advanced tab page to set the following advanced server property.openam.session.useLocalSessionsInMultiServerMode = true
When you set this property to
truefor your OpenAM servers, users can potentially reach the session quota for each individual server before all session quotas are exhausted. In other words if you have 4 OpenAM servers and Set Active User Sessions is 5, then the user can have a maximum of 20 (5 * 4) sessions.
-

![[Important]](common/images/admon/important.png)
