don't set cookies if in the API (bug 866322)