fixed mistakes in cookie-setting command

added debug print for weird error;