Sessions do not terminate automatically as there could be new process instances being started etc. To terminate a session, call ksession.dispose(). If you want to terminate a session after the process instance has been completed, you could for example register a process event listener that disposes a specific session if the process instance has been completed.
Kris