My main point is that the session expire should not be handled by the client library but application logic, since only application knows what's the correct action for a session expire event. You don't want to hide it from the client.