Feature Pack 4 or later

Working with REST sessions

You can work with sessions to change timeouts for REST services, and to ensure that REST requests are made to the proper node, either with session affinity or cache replication.

Procedure

  • To change the session timeout value for REST services:
    1. Change the web services session timeout for channel ID -1.
      For example:
      
      <ExpiryManagement ExpiryMgmtChannelId="-4, -1"
      InactivityTimeout="15" Threshold="15" enable="true"/>
      
      Note: Enabling session timeout for channel ID -1 affects the storefront, which also uses the default channel ID -1. This setting results in both session timeout (which is activity-based) and cookie-based login timeout to be enabled in the storefront. It is recommended to configure activity-based session timeout to be longer than cookie-based login timeout, so that cookie-based login timeout is activated before activity-based session timeout. For more information, see Enabling login timeout for a cookie-based session.
  • Recommended: To enable session affinity, so that REST requests are made to the proper server node, contact IBM Support to obtain APAR JR51204. This APAR adds a JSESSIONID cookie to the response so that session affinity is used for REST requests.
  • Alternately, to use cache replication instead of session affinity:
    1. Enable the dynamic cache service and servlet caching.
      Ensure that all custom properties are defined.
    2. Enable WebSphere Commerce data cache. Ensure that the WC_eardir/Stores.war/WEB-INF/cacheinstances.properties file enables the services/cache/WCSessionDistributedMapCache and cache.instance.n.enableCacheReplication is set to true.
    3. Ensure that the wc-server.xml file contains the following entry in the CrossTransactionCache element:
      
      <com.ibm.commerce.component.contextservice.commands.ContextDataSerValueCacheCmdImpl enabled="true" />
      
    4. Ensure that the WC_eardir/InitializationServlet.war/WEB-INF/cachespec.xml file contains an entry for the ContextDataSerValueCacheCmdImpl.