Session affinity

In the Servlet 2.3 specification, as implemented by WAS V5.0 and higher, only a single cluster member may control/access a given session at a time. After a session has been created, all requests need to go to the appserver that created the session. This session affinity is provided by the plug-in.

In a clustered environment, there will be more than one appserver that can serve the client request. The plug-in needs to read a request and be able to identify which cluster member should handle it. Session identifiers are used to do this. The session key is used by the Web container to retrieve the current session object.

Example 5-7 Example of a session identifier

JSESSIONID=0000A2MB4IJozU_VM8IffsMNfdR:v544d0o0

As shown in Example 5-7, the JSESSIONID cookie can be divided into four parts:

Table 5-3 shows the mappings of these parts based on Example 5-7.

Table 5-3
Content Value used in the example
Cache ID 0000
Session ID A2MB4IJozU_VM8IffsMNfdR
Separator :
Clone ID (cluster member) v544d0o0

A clone ID is the ID of a cluster member as shown in Example 5-8.

Example 5-8 Extract of plugin-cfg.xml showing the CloneID

<Server CloneID="v544d0o0" 
        ConnectTimeout="0" 
        ExtendedHandshake="false" 
        LoadBalanceWeight="2" 
        MaxConnections="-1" 
        Name="was2Node_PluginMember2" 
        WaitForContinue="false">

 

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.