implemented manual login/logoff and session