If the session expires, the session id will likely be treated as a new session by the server.
If so, there's no need to look up the session timeout or refresh the session id before it times out.
If the timeout is useful, the client should allow for the case where the appserver is not a REST API server, maybe by catching the exception and retrying with a new session id.