Working login/logout,/logout, mostly