fixed bug with login button

Simple fix to the login button. Currently if the user hit the back or home button while in the app, the button changes back to login but the isLoggedIn flag is still true. This fix allows the user to stay logged in until they log out or fully close the app.