Hitachi

Hitachi Application Server V10 User's Guide (For Windows® Systems)


3.3 Overview of session management

Session management means managing the association between requests and web clients by using server IDs and session IDs. A "session" is a mechanism that associates business information with requests from a business system user's login to logout. Session management allows a system that uses a load balancer to continue sessions.

Session management mechanism

Application Server adds the same session ID to cookies and query strings in a series of requests during a session to continue the session.

The following figure shows how the session is maintained in the system configuration including a load balancer.

[Figure]

  1. First request from the client

    When receiving the first request from the client, the load balancer transfers the request to Application Server 1. At this time, the load balancer includes a server identification cookie in the request to Application Server 1.

  2. Response to the first request

    Application Server 1 sends a response containing the server identification cookie and the session ID to the client.

  3. Second request from the client

    The client sends the second request containing the server identification cookie to the load balancer. When receiving the second request, the load balancer determines the request transfer destination from the server identification cookie in the request, and then sends the request to the server (Application Server 1) that has established the session.

Session ID structure

Application Server adds a server ID to a session ID in order to ensure that unique session IDs are used for session management. The following shows the session ID structure.

[Figure]

The 33rd and subsequent characters in the session ID contain a server ID, which is different for each Java EE server. This ensures that the session IDs are unique among multiple Java EE servers in the system.

Combining a cluster configuration and session replication to continue a session

If a server processing a request cannot continue processing due to an error, Application Server uses session replication to copy information about the ongoing session to another server that is free of error. Then, Application Server continues the session based on the replicated session information. Session replication can be used in a cluster configuration. The following figure shows the in-memory replication configuration in which each server individually operates as a backup of the session.

[Figure]

Enabling the web server settings to ensure the continuity of sessions

When you execute the create-relation subcommand of the asadmin utility command for the cluster from the web server to create a dependency relation, the web server settings that ensure the continuity of sessions are enabled.

asadmin create-relation --relationtype redirect --from web_server_name --to cluster_name --properties property_name_of_dependency_relation=value[:property_name_of_dependency_relation=value] dependency_relation_name

Settings to enable session replication

The following describes the settings that enable session replication.