Fixed cookie funtionality.