+

Search Tips   |   Advanced Search

 

Assembling so that session data can be shared

 

By default, the Session Management facility supports session scoping by Web module in accordance with the Servlet 2.3 API specification. Only servlets in the same Web module can access the data associated with a particular session. You can use the IBM extension, Shared session context, to extend the scope of the session attributes to an enterprise application to share session attributes across all the Web modules in an enterprise application.

 

Overview

To use this option, install all the Web modules in the enterprise application on a given server. You cannot split up Web modules in the enterprise application by servers. For example, with an enterprise application containing two Web modules, you cannot use this option when one Web module is installed on one server and second Web module is installed on a different server. In such split installations, applications might share session attributes across Web modules using distributed sessions, but session data integrity is lost when concurrent access to a session is made in different Web modules. It also severely restricts use of some Session Management features, like TIME_BASED_WRITES. For enterprise applications on which this option is enabled, the Session Management configuration on the Web module inside the enterprise application is ignored. Then Session Management configuration defined on enterprise application is used if Session Management is overwritten at the enterprise application level. Otherwise, the Session Management configuration on the Web container is used.

Servlet API Behavior

If shared HttpSession context is turned on in an enterprise application, HttpSession listeners defined in all the Web modules inside the enterprise application are invoked for session events. The order of listener invocation is not guaranteed.

Do the following to share session data across Web modules in an enterprise application.

 

Procedure

  1. Start an assembly tool. See "Starting WAS Toolkit" in the Application Server Toolkit documentation for more information.

  2. In the assembly tool, right-click the application (EAR file) you want to share and click Open With > Deployment Descriptor Editor.

  3. In the application deployment descriptor editor of the assembly tool, select Shared session context under WebSphere Extensions. Make sure the class definition of attributes put into session are available to all Web modules in the enterprise application. The shared session context does not fully meet the requirements of the Specifications.

  4. Save the application (EAR) file. In the assembly tool, after you close the application deployment descriptor editor, confirm that you want to save changes made to the application.



Session management support

 

Related Reference


HTTP session problems