JS cleanup, dynamic cookie control