Add automatic check of login status on page refresh.