removed alert, added undefined alternatives for cookie