Configuring session data storage for the Session-enabled Content Service

Configure Experience Manager to store session data in a dedicated database by editing the Storage Layer configuration files, cd_storage_conf.xml, used by the Session-enabled Content Service. If you have two or more staging environments, you can also configure load balancing.

Procedure

  1. In the configuration directory of the Role, open cd_storage_conf.xml for editing.
  2. If you intend to run this software component as a microservice, or as a web application that contains only this software component, remove all references to other databases than the Content Data Store.
  3. Inside the <Storages> section, add a <Wrappers> section.
    Here is an example of a Wrappers section that configures storage for a SQL Server database:
    <Wrappers>
    	<Wrapper Name="SessionWrapper">
    		<Timeout>120000</Timeout>
    		<Storage Type="persistence" Id="db-session" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory">
    			<Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
    			<DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
    				<Property Name="serverName" Value="myserver" />
    				<Property Name="portNumber" Value="1433" />
    				<Property Name="databaseName" Value="mydb" />
    				<Property Name="user" Value="admin" />
    				<Property Name="password" Value="kumquat" />
    			</DataSource>
    		</Storage>
    	</Wrapper>
    </Wrappers>
    And here is an example of a Wrappers section that configures storage for an Oracle database:
    <Wrappers>
    	<Wrapper Name="SessionWrapper">
    		<Timeout>120000</Timeout>
      <Storage Type="persistence" Id="db-session" dialect="ORACLESQL"	Class="com.tridion.storage.persistence.JPADAOFactory">
    			<Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
    			<DataSource Class="oracle.jdbc.pool.OracleDataSource">
    				<Property Name="driverType" Value="thin" />
    				<Property Name="networkProtocol" Value="tcp" />
    				<Property Name="serverName" Value="myserver" />
    				<Property Name="portNumber" Value="1433" />
    				<Property Name="databaseName" Value="mydb" />
    				<Property Name="user" Value="admin" />
    				<Property Name="password" Value="kumquat" />
    			</DataSource>
    		</Storage>
    	</Wrapper>
    </Wrappers>

    If you are connecting to Oracle RAC, use the property name serviceName instead of databaseName.

    The Storage element in this fragment must refer to your Experience Manager database.

  4. To configure load balancing, do the following:
    1. In the <Wrapper> element, add a <MachineName> element specifying a logical name:
      <Wrappers>
      	<Wrapper Name="SessionWrapper">
      		<MachineName>MachineName</MachineName>    
      		<Storage>
      			...
      		</Storage>
      	</Wrapper>
      </Wrappers>
      The maximum length of the <MachineName> element is 100 characters and the value needs to be unique for each web application in the load balanced environment.
    2. Configure the same database in the cd_storage_conf.xml for all web applications or microservices in the load-balanced environment.
  5. Save and close cd_storage_conf.xml.