Changed condition to isset to ensure that the cookie exists before trying to reference it.