RolandL/SteveE: Some code to handle session expiry, auto-refreshing of token