Set up session expiration detection and routine to log back in