Updated js for cookie check
Updated js for post check