Working with web container session manager properties files

You can use properties files to change session manager properties under the web container and associated tuningParams, sessionDatabasePersistence, and defaultCookieSettings attributes under a server.

Before you begin

Determine the changes that you want to make to your session manager configuration.

Start the wsadmin scripting tool. To start wsadmin using the Jython language, run the wsadmin -lang Jython command from the bin directory of the server profile.

About this task

Using a properties file, you can create, modify, or delete a session manager configuration properties.

Run administrative commands using wsadmin to change a properties file for a session manager, validate the properties, and apply them to your configuration.

Table 1. Actions for session manager properties files . You can create, modify, and delete session manager properties.
Action Procedure
create Not applicable
modify Edit properties and then run the applyConfigProperties command.
delete Not applicable
create Property Set properties and then run the applyConfigProperties command.
delete Property Specify the properties to delete in the properties file and then run the deleteConfigProperties command.

Optionally, you can use interactive mode with the commands:

AdminTask.command_name('-interactive')

Procedure

  • Create session manager properties.
    1. Specify SessionManager properties under the WebContainer in a properties file.

      In an editor, specify WebContainer SessionManager properties and associated tuningParams, sessionDatabasePersistence, and defaultCookieSettings attributes under a server in a properties file. You can copy the following example properties into an editor and modify the properties as needed for your situation.

      #
      # SubSection 1.0.7 # Session Manager
      #
      ResourceType=SessionManager
      ImplementingResourceType=WebContainer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=
      :WebContainer=:SessionManager=
      AttributeInfo=services
      #
      
      #
      #Properties
      #
      enableSecurityIntegration=false #boolean,default(false)
      maxWaitTime=5 #integer,default(0)
      context=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=:WebContainer=
       #ObjectName(WebContainer),readonly
      allowSerializedSessionAccess=false #boolean,default(false)
      enableProtocolSwitchRewriting=false #boolean,default(false)
      enableUrlRewriting=false #boolean,default(false)
      enable=true #boolean,default(false)
      accessSessionOnTimeout=true #boolean,default(true)
      enableSSLTracking=false #boolean,default(false)
      sessionPersistenceMode=NONE #ENUM(DATABASE|DATA_REPLICATION|NONE),default(NONE)
      enableCookies=true #boolean,default(true)
      
      #
      # SubSection 1.0.7.1 # Session Manager's Tuning Parameters
      #
      ResourceType=TuningParams
      ImplementingResourceType=WebContainer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=:WebContainer=
      :SessionManager=:TuningParams=
      AttributeInfo=tuningParams
      #
      
      #
      #Properties
      #
      writeContents=ONLY_UPDATED_ATTRIBUTES #ENUM(ALL_SESSION_ATTRIBUTES|ONLY_UPDATED_ATTRIBUTES),
      default(ONLY_UPDATED_ATTRIBUTES)usingMultiRowSchema=false #boolean,default(false)
      allowOverflow=true #boolean,default(true)
      writeFrequency=TIME_BASED_WRITE #ENUM(TIME_BASED_WRITE|END_OF_SERVLET_SERVICE|MANUAL_UPDATE),
      default(END_OF_SERVLET_SERVICE)
      invalidationTimeout=30 #integer,default(30)
      scheduleInvalidation=false #boolean,default(false)
      writeInterval=10 #integer,default(120)
      maxInMemorySessionCount=1000 #integer,default(1000)
      
      #
      # SubSection 1.0.7.1.1 # Session Manager's Tuning Parameters
      #
      ResourceType=InvalidationSchedule
      ImplementingResourceType=WebContainer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=:WebContainer= 
      :SessionManager=:TuningParams=:InvalidationSchedule=
      AttributeInfo=invalidationSchedule
      #
      
      #
      #Properties
      #
      secondHour=2 #default(0)
      firstHour=14 #default(0)
      
      #
      # SubSection 1.0.7.3 # Session Manager's SessionDatabasePersistence
      #
      ResourceType=SessionDatabasePersistence
      ImplementingResourceType=WebContainer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=
      :WebContainer=:SessionManager=:SessionDatabasePersistence=
      AttributeInfo=sessionDatabasePersistence
      #
      
      #
      #Properties
      #
      password="{xor}Oz1tPjsyNjE="
      userId=db2admin
      tableSpaceName=
      datasourceJNDIName="jdbc/Sessions" #required
      db2RowSize=ROW_SIZE_4KB #ENUM(ROW_SIZE_4KB|ROW_SIZE_32KB|ROW_SIZE_16KB|ROW_SIZE_8KB),default(ROW_SIZE_4KB)
      
      #
      # SubSection 1.0.7.4 # Session Manager's Cookie
      #
      ResourceType=Cookie
      ImplementingResourceType=WebContainer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=:WebContainer=
      :SessionManager=:Cookie=
      AttributeInfo=defaultCookieSettings
      #
      
      #
      #Properties
      #
      maximumAge=-1 #integer,default(-1)
      name=JSESSIONID #default(JSESSIONID)
      domain=
      secure=false #boolean,default(false)
      path=/ #default(/)
      
      EnvironmentVariablesSection
      #
      #Environment Variables
      cellName=WASCell06
      serverName=myServer
      nodeName=WASNode04
    2. Run the applyConfigProperties command to create a WebContainer SessionManager configuration.

      Running the applyConfigProperties command applies the properties file to the configuration. In this Jython example, the optional -reportFileName parameter produces a report named report.txt:

      AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt '])
  • Modify existing session manager properties.
    1. Obtain a properties file for the session manager that you want to change.

      You can extract a properties file for a WebContainer SessionManager using the extractConfigProperties command.

    2. Open the properties file in an editor and change the properties as needed.

      Ensure that the environment variables in the properties file match your system.

    3. Run the applyConfigProperties command.
  • Delete the session manager properties.

    To delete one or more properties, specify only those properties to delete in the properties file and run deleteConfigProperties.

    AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]') 

Results

You can use the properties file to configure and manage the session manager.

What to do next

Save the changes to your configuration.