switched some jquery cookie code to php