UNICOM® Digital Transformation Toolkit (UDTT™) provides a utility method in the com.ibm.btt.sm.CSSessionHandler class:
public static void markSessionExpired(String sessionId) throws BTTSMException
After calling this method, the session will be marked as expired and the session 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.
Sample code
public class LogoutOpStep extends BTTServerOperation { public void execute() throws Exception { System.out.println("====== LogoutOpStep Start ====="); // do some clean up, after that mark session expired HttpSession session= WebChannelContext.getHttpServletRequest().getSession(); String sessionId=session.getId(); CSSessionHandler.markSessionExpired(sessionId); System.out.println("====== LogoutOpStep End ====="); } }