js for cookie mechanics in place