Constructor and login/out functions for LoginView