Express middleware for dynamically setting the cookie domain.