Login/logout working - needs improvement