Persist login state to avoid unwanted page refresh.

The issue was easier to demonstrate when the app didn't persist
the session using localStorage, but this forced a page refresh.
Now logout is required to reset everything.