Session management custom properties

You can specify additional settings for session management through setting custom properties.

Session management properties, like the session management configuration, can be configured at the server, application, or web module level. The following steps are for setting the custom properties for session management at the server level.
  1. In the administrative console click Servers > Server Types > WebSphere application servers > server_name > Session management.
  2. Under Additional Properties select Custom Properties.
  3. On the Custom Properties page, click New.
  4. On the settings page, enter the property that you want to configure in the Name field and the value that you want to set it to in the Value field.
  5. Click Apply or OK.
  6. Click Save on the console task bar to save your configuration changes.
  7. Restart the server.

AlwaysEncodeURL

The Servlet 2.5 specification specifies to not encode the URL on a response.encodeURLcall if it is not necessary. To support compatibility with earlier versions when URL encoding is enabled, set the AlwaysEncodeURL custom property to true to call the encodeURL method. The URL is always encoded, even if the browser supports cookies. The property must be configured at the web container level.

CheckSessionCookieNameOnEncodeURL

Use this property to check for the existence of the HTTP session cookie when determining whether the session ID needs to be encoded in the URL. This property must be configured at the web container level.

The default setting for this property is false. When you set this property to true, you enable the session manager to check for the existence of the HTTP session cookie when determining whether the session ID needs to be encoded in the URL.

checkSessionNewOnIsValidRequest

Use this property to specify whether the server can handle multiple simultaneous client requests when HttpSessionIdReuse is enabled. This property must be configured at the web container level.

By default, the session manager handles one client request at a time when property HttpSessionIdReuse is also enabled. Set checkSessionNewOnIsValidRequest to false to allow the session manager to handle multiple simultaneous requests from a client when HttpSessionIdReuse is enabled. If HttpSessionIdReuse is not enabled, this property has no effect.

You must restart the server for the configuration change to take effect.

The default value for this property is true.

CloneSeparator

Use this property to specify a different character as the clone separator in session cookies. The value specified for this custom property must be a single character.

This property was set as a web container custom property in Version 6.1 but must now be set as a session management custom property at the web container level.

Best practice: This property should only be used as a means to provide more flexibility if you have a situation where you cannot use either a colon (:), or a plus sign (+) as the clone separator in session cookies. You should understand the clone character requirements of other products running on your system before using this property to change the clone separator character.

The fact that any character can be specified as the value for this custom property does not imply that the character you specify will function correctly. This fact also does not imply that IBM is responsible for fixing any problem that might arise from using an alternative character.

Avoid trouble: If the JVM you are configuring is part of a cluster, make sure to configure other cluster members with this property and using the same value in order for the plugin to maintain affinity. Plugin regeneration and propagation are required after configuration.

CloneSeparatorChange

Use this property to maintain session affinity. The clone ID of the server is appended to session identifier separated by colon. On some Wireless Application Protocol (WAP) devices, a colon is not allowed. Set this property to true to change clone separator to a plus sign (+). This property must be configured at the web container level.

Avoid trouble: If the JVM you are configuring is part of a cluster, make sure to configure other cluster members with this property and using the same value in order for the plugin to maintain affinity. Plugin regeneration and propagation are required after configuration.

ConnectionRetryCount

Use this property to select the number of retry attempts on a database connection.

For example, when ConnectionRetryCount set to 0, the session manager attempts a database connection once only, with no retry attempt.

The default value for this property is 2.

[8.5.5.18 or later]

CookieSameSite

Use this property to specify a SameSite attribute value to use for session cookies.

The following table shows the values for the SameSite attribute and information about each value. The values are case-insensitive.

Value Information
Lax Specify this value to set the SameSite attribute value on a session cookie to Lax. The session cookie that is sent is for cross-site requests that use a safe HTTP method and for same-site requests.
None Specify this value to set the SameSite attribute value on a session cookie to None. The session cookie that is sent is for same-site requests only. When you set the value to None, the Secure attribute is set on the session cookie.
Strict Specify this value to set the SameSite attribute value on a session cookie to Strict. The session cookie that is sent is for same-site requests and cross-site requests.
Disabled Specify this value so that the SameSite attribute is not added to the session cookie. The Disabled value is the default.

DebugSessionCrossover

The DebugSessionCrossover custom property enables code to perform additional checks to verify that only the session associated with the request is accessed or referenced. Messages are logged if any discrepancies are detected.

Set this property to true to enable session data crossover detection.

See article, HTTP session problems, for additional information.

DelayAfterDuplicateIdException

The DelayAfterDuplicateIdException custom property is used to specify how long, in milliseconds, the session manager should wait before attempting to retrieve a session from the backend server after a SESN0196W error occurs. This property must be configured at the web container level.

The default value for this property is 500.

DelayInvalidationAlarmDuringServerStartup

Use this property to delay the startup of the invalidation alarm upon server startup by the specified number of seconds.

The default value for this property is 0.

ForceSessionInvalidationMultiple

The ForceSessionInvalidationMultiple custom property indicates whether the session manager should wait indefinitely for a request to complete before attempting to invalidate the session, or should attempt to invalidate a session after the specified time limit has elapsed. The default value for this property is 3.

  • If you specify 0 (zero) for this custom property, the session manager waits indefinitely until a request is complete before attempting to invalidate the session.

    If your requests normally are not bound by a response time limit, specify 0 for this property.

  • If you specify a positive integer, such as 1, 2, or 3, for this custom property, even if a session is not known to have completed, the session manager attempts to invalidate the session, if the indicated time period since the last access occurred has elapsed. This time period is the result of multiplying the value specified for this property and the value specified for the Session Timeout property. For example, if you specify 2 minutes for the Session Timeout property and 2 for the ForceSessionInvalidationMultiple property, the session manager attempts to invalidate the session after 4 minutes.

    If you want to invalidate your sessions after a certain amount of time has elapsed, specify the appropriate positive integer for this property.

HideSessionValues

The HideSessionValues custom property prevents the logging of session attribute values in session manager traces. This property must be configured at the web container level.

Applications store these session attribute values. The default value is true.

HttpSessionCloneId

Use this property to change the clone ID of the cluster member. Within a cluster, this ID must be unique to maintain session affinity. When set, this name overwrites the default name generated by WebSphere Application Server. This property must be configured at the web container level.

[AIX Solaris HP-UX Linux Windows]Default clone ID length: 8 or 9

[z/OS][IBM i]Default clone ID length: 40

Avoid trouble: If the JVM you are configuring is part of cluster, make sure to configure other cluster members for this property but with different unique values. All cluster members should have this property set to different unique values.
[z/OS]

HttpSessionEnableUnmanagedServerReplication

Set this custom property to true if you want to enable servant failover by replicating session data to a controller managed data space. The default value is false.

HttpSessionIdLength

Use this property to configure the session identifier length. Do not use an extremely low value; using a low value results in reduced number of combinations possible, thereby increasing risk of guessing the session identifier. In a cluster, all cluster members should be configured with same ID length. Allowed range: 8 to 128. Default length: 23. This property must be configured at the web container level.

HttpSessionIdReuse

The custom property HttpSessionIdReuse determines whether the session manager can use the session ID sent from a browser to preserve session data across web applications that are running in an environment that is not configured for session persistence. This property must be configured at the web container level.

In a multi-JVM environment that is not configured for session persistence setting this property to true enables the session manager to use the same session information for all of a user's requests even if the web applications that are handling these requests are governed by different JVMs. The default value for this property is false. Set this property to true if you want to enable the session manager to use the session ID sent from a browser to preserve session data across web applications that are running in an environment that is not configured for session persistence.

[z/OS]In a z/OS system that includes multiple servants, on rare occasions two requests come in at approximately the same time, and are routed to two separate servants. However, because the two requests come in at approximately the same time, they both request a new session with the same session ID. If the HttpSessionIdReuse property is set to true when this situation occurs, the following error message is logged for one of the servants, and the servant where the message is logged does not get a session:
ExtendedMessage: BBOO0220E: SessionContext:createSession - call to
establishAffinity for id id_number failed with rc 4

HttpSessionReaperPollInterval

Use this property to specify, in seconds, a wake-up interval for the process that removes invalid sessions. The value specified for this property overrides the default installation value, which is between 30 and 360 seconds, and ensures that the reaper process runs at a specific interval.

If the maximum inactive interval is less than 2 minutes, the reaper poll interval is usually between 30 to 60 seconds.

If the maximum inactive interval is more than 2 minutes and up to 15 minutes, the reaper poll interval is usually between 60 to 90 seconds.

If the maximum inactive interval is more than 15 minutes and up to 30 minutes, the reaper poll interval is usually between 120 to 180 seconds.

If the maximum inactive interval is more than 30 minutes, the reaper poll interval is usually between 240 to 300 seconds.

Because the default timeout and maximum inactive interval is 30 minutes, the reaper interval is usually between 2 and 3 minutes.

For example, you might want to use this property if you want the installation timed out sessions invalidated more frequently than 2 to 3 minutes. Specifying HttpSessionReaperPollInterval=120 ensures that sessions are invalidated within 2 minutes of timing out.

The minimum value for this property is 30 seconds. If a value less than the minimum is entered, the specified property is ignored and an appropriate value is automatically determined and used. The maximum inactive interval is the session timeout. The default is based on maximum inactive interval set in session management.

InvalidateOnUnauthorizedSessionRequestException

Set this property to true if, in response to an unauthorized request, you want the session manager to invalidate a session instead of issuing an UnauthorizedSessionRequestException error message.

When a session is invalidated, the requester can create a new session, but does not have access to any of the previously saved session data. This invalidation allows a single user to continue processing requests after a logout while still protecting session data.

The default value for this property is false.

NoAdditionalSessionInfo

Set this property to true to force removal of information that is not needed in session identifiers. This property must be configured at the web container level.

NoAffinitySwitchBack

Set this property to true to maintain affinity to the new member even after original one comes back up. When a cluster member fails, its requests routed to a different cluster member, and sessions are activated in that other member. Thus, session affinity is maintained to the new member, and when failed cluster member comes back up, the requests for sessions that were created in the original cluster member are routed back to it. Allowed values are true or false, with the default being false. This property must be configured at the web container level.

Set this property to true when you have distributed sessions configured with time-based write. When using Memory-to-memory session replication, set custom property HttpSessionCloneId to use the affinity switch back. Note that this property has no affect on the behavior when distributed sessions are not enabled

OptimizeCacheIdIncrements

Set the OptimizeCacheIdIncrements custom property to true to make the session manager assess whether the in-memory session for a web module is older than the copy in persistent store. Setting this property resolves the continually increasing cache ID.

If HTTP session management is configured to use session persistence and the user's browser session is moving back and forth across multiple web applications you might see extra persistent store activity as the in-memory sessions for a web module are refreshed from the persistent store. As a result, the cache IDs are continually increasing and the in-memory session attributes are overwritten by those of the persistent copy. Set this property to true if you want to prevent the cache IDs from continually increasing.

If the configuration is a cluster, ensure that the system times of each cluster member is identical as possible.

SecurityUserIgnoreCase

Set this property to true if you want the session security identity and the client security identity to be considered a match even if their cases are different.

When a user configures session security integration, the session manager compares the security identity of th session owner with the security identity of the client request. Because the matching criteria is case sensitive, if these two identities do not exactly match, an UnauthorizedSessionRequestException is sent back to the client.

If you have situations where you want the session security identity and the client security identity to be considered a match even if their cases are different, add the SecurityUserIgnoreCase custom property to your Web container configuration settings, and set the property to true. When this property is set to true, an UnauthorizedSessionRequestException does not occur if the session security identity and the client security identity are identical except for their cases. For example, when this property is set to true, the session security identity USER1 matches the client security identities User1 and user1.

Servlet21SessionCompatibility

Set this custom property to true to enable global session behavior. In Servlet 2.2 and later, sessions are scoped at the Web module level. The default is false.

Deprecated feature: This property is deprecated. The IBMApplicationSession method replaces the function of the Servlet21SessionCompatibility custom property.

SessionIdentifierMaxLength

Use this value to set maximum length that a session identifier can grow. This property must be configured at the web container level.

In a cluster, because of fail-over when a request goes to new cluster member, session management appends a new clone ID to the existing clone ID. In a large cluster, if for some reason servers are failing more often, then it is possible that the session identifier length can be more than expected reducing room for URL. This property helps to find out the condition and take appropriate action to address servers fail-over. When this is specified, message is logged when specified maximum length is reached. Allowed value: integer.

SessionInvalidatorThreadPoolSize

Defines the maximum size of the thread pool for the threads that reap invalid sessions after they have timed out. These threads are responsible for notifying other servers if the sessions are distributed and cleaning up any local references to them. Higher frequency of sessions timing out due to a shorter timeout interval as well as a larger number of sessions due to high volume of traffic will drive a need for a higher number of these threads.

The default value is 50. The minimum value is 20 and the maximum value is 100.

SessionRewriteIdentifier

Use this property to change the key used with URL rewriting. The default key is jsessionid.

SessionTableName

Use this custom property to set the database table name. Allowed value: String. The default value is SESSIONS.

Some applications may rely on method ejbCreate(...) to have created the entity bean in the database. For such a requirement, setting the JVM property com.ibm.websphere.ejbcontainer.allowEarlyInsert to true overrides the default behavior.

SessionTableSkipIndexCreation

Use this property to disable index creation on server startup.

This custom property should only be used if you want to manually create your own database indices for session persistence. However, it is recommended that you let session manager create database indices.

To enable this property, go to the session management custom properties administrative console page, enter the SessionTableSkipIndexCreation property name and set its value to true. Before enabling this property, make sure that the correct index does exist on your session database.

ThrowSecurityExceptionOnGetSessionFalse

Set this custom property to false to allow session management to return a null session value instead of an UnauthorizedSessionrequestException. The default value is true.

UseInvalidatedId

Set this custom property to true to reuse the incoming ID if the session with that ID was recently invalidated. This is a performance optimization because it prevents checking the persistent store. The default value is true.

UseOracleBLOB

The UseOracleBLOB custom property creates the HTTP session database table using the Binary Large Object (BLOB) data type for the medium column. This property increases performance of persistent sessions when Oracle databases are used. You must also ensure that a new sessions table is created before the server is restarted by dropping your old sessions table or by changing the datasource definition to reference a database that does not contain a sessions table.

To create a sessions table using the BLOB data type, use the following name-value pair:
Name Value
UseOracleBLOB true

UsingApplicationSessionsAndInvalidateAll

When the invalidateAllSet method is called, not all IBMApplicationSessions objects are checked. This property must be configured at the web container level. If you are using both the IBMApplicationSessions object and the invalidateAll call, use the following name-value pair:

Name Value
UsingApplicationSessionsAndInvalidateAll true

UsingCustomSchemaName

Use this property to ensure that the session manager successfully detects the sessions table on subsequent server startups.

Set this custom property to true if you are using DB2 for sessions persistence and the customSchema property is not set to the default value in the DB2 JDBC driver.

The default value is false.