Login and logout working properly now