Added part of new session mgt code.