Configure session management for Web modules

Application Web modules use sessions to associate HTTP requests from a single client. Session management settings determine how your application manages HTTP sessions.

You can configure sessions for a Web module if you want the module to use different settings from other Web modules that are deployed on your application server, including other Web modules in the same application. The Web module settings take precedence over the application and application server settings.

Use the administrative console to configure session management for Web modules

  1. Start the administrative console.
  2. Expand Applications and click Enterprise Applications.
  3. Click the name of the application for which you want to manage session tracking.
  4. On the application's page, click Web Modules.
  5. Click the URI for the Web module for which you want to configure session tracking.
  6. On the Web module's page, click Session Management.
  7. Configure session management settings.
  8. Click Apply or OK.
  9. Save the application server configuration.

Use wsadmin to configure session management for Web modules

  1. On the CL command line, run the STRQSH (Start Qshell) command.

  2. Run the cd command to change to the directory that contains the wsadmin tool:

    cd /QIBM/ProdData/WebASE51/ASE/bin
  3. Start wsadmin.

  4. At the wsadmin prompt, run this command to identify the deployment configuration object for the application and assign it to the deployment variable:

    set deployment [$AdminConfig getid /Deployment:myApp/]

    where myApp is the name of the application for which you want to configure session management.

  5. Run these commands to list all of the modules in the application and assign them to the modules variable:

    set appDeploy [$AdminConfig showAttribute $deployment deployedObject]
    set modules [lindex [$AdminConfig showAttribute $appDeploy modules] 0]
  6. Use the attributes command to display a list of the attributes that you can set for the session manager:

    $AdminConfig attributes SessionManager

    The command displays this output:

    "accessSessionOnTimeout Boolean"
    "allowSerializedSessionAccess Boolean"
    "context ServiceContext@"
    "defaultCookieSettings Cookie"
    "enable Boolean"
    "enableCookies Boolean"
    "enableProtocolSwitchRewriting Boolean"
    "enableSSLTracking Boolean"
    "enableSecurityIntegration Boolean"
    "enableUrlRewriting Boolean"
    "maxWaitTime Integer"
    "properties Property(TypedProperty)*"
    "sessionDRSPersistence DRSSettings"
    "sessionDatabasePersistence SessionDatabasePersistence"
    "sessionPersistenceMode ENUM(DATABASE, DATA_REPLICATION, NONE)"
    "tuningParams TuningParams"

    Notes:

  7. Set attributes for the session manager. For example, run these commands to set the enableSecurityIntegration, maxWaitTime, sessionPersistenceMode, and enable attributes

    set attr1 [list enableSecurityIntegration true]
    set attr2 [list maxWaitTime 30]
    set attr3 [list sessionPersistenceMode NONE]
    set attr4 [list enable true]
    set attrs [list $attr1 $attr2 $attr3 $attr4]
    set sessionMgr [list sessionManagement $attrs]

    You can set attributes in the session manager, including the nested attributes in Cookie, DRSSettings, SessionDataPersistence, and TuningParms object types. To list the attributes for those object types, run the attribute command for each object type.

  8. Run these commands to set the attributes for Web module:

    set nameAttr [list name myWebModuleConfig]
    set descAttr [list description "myWebModuleDescription"]
    set webAttrs [list $nameAttr $descAttr $sessionMgr]

    where myWebModuleConfig is the name for the configuration and myWebModuleDescription is a brief description of the configuration.

  9. Create the session manager for each Web module in the application:

    foreach module $modules {
        if {[regexp WebModuleDeployment $module] == 1} {
          $AdminConfig create WebModuleConfig $module $webAttrs
        }
      }

    You can modify this example to set other attributes of session manager in Web module configuration.

  10. Run this command to save your changes:

    $AdminConfig save