Migrating Session Management

About this task
This topic introduces how you can migrate BTT version 5.2 Session Management to BTT version 7.0 Session Management.

BTT provides the following utility method in the com.ibm.btt.sm.CSSessionHandler class:

Public static void markSessionExpired(HttpSession aSession) throws BTTSMException. After this method is called, the session will be marked as expired and will be removed at the end of operation. You need to call this method in the logoff operation. Then, the session context will be cleaned and the HTTP session object will be destroyed after you log off the application.

BTT version 5.2 supports both cookie=true and cookie=false modes.
  • When cookie=true, HttpSessionHandler object is used in the HttpSession that implements the interface HttpSessionBindingListener. When the HttpSession is invalidated, the endSession(sessionId) method is triggered.
  • When cookie=false, BTT channel is responsible for the session expiration. It uses a dedicated thread CSSessionManager to check the expired sessions regularly with the method checkExpiredSessions(). And it ends the expired BTT session.

In BTT version 7.0, only cookie=true mode is supported. Session management is delegated to HttpSession. You need to add the HttpSession listener in your WAR project for session management.

To migrate the cookie=false mode in BTT version 5.2, you need to migrate your old mechanism to the HttpSession timeout mechanism. Add the following HttpSession timeout listener in the web.xml file:
<listener>
<listener-class>com.ibm.btt.sm.TimeoutHandler</listener-class>
</listener>