A session is a conversation between a user (browser), client, or server that contains one or more sets of requests and responses. Sessions enable these entities to share data within the conversation yet distinguish the data from data in other conversations. For example, Tim logs on. This creates a session that contains information about Tim and the client that he is using. If Elaine logs on, a different conversation occurs and results in a different session. If Tim and Elaine both request to transfer money into an account, the server is able to distinguish between the two requests by their sessions. The server uses sessions to remember the client (or user) and the resources allocated for the client, share the client-related data between subsequent requests, and send proper responses back to the correct requester. To maintain information about the user, client, and system, a session uses contexts.
The Branch Transformation Toolkit sessions are based on J2EE technology and are in the presentation layer.
The central part of sessions is the session context. When a session is established, the context for the session is also created and a link between the two is established in the session table. The layers pass session data using session ID. The receiving layer uses the session ID as a key to retrieve session data. In the application logic layer, the session context is usually the parent of the business process context within the CHA hierarchy. By calling APIs such as getValueAt() and setValueAt() provided by CHA, a business process or Single Action EJB can retrieve the application data from the session CHA context.
The toolkit provides a TimeoutHandler class for cleaning up the resources and information of expired sessions. Based on this class, you can write your own TimeoutHandler to do the session clean-up.