Wrong variable was being used in cookie creation.