Add debugging information and fix unneccessary saves due cookie functions