protected function serveCookies($cookies)
    {
        foreach ($cookies as $cookie) {
            if ($cookie->hasChanged()) {
                $expiration = $cookie->getExpiration();
                if (isset($expiration)) {
                    $expiration = $expiration->getTimestamp();
                } else {
                    $expiration = 0;
                }
                setcookie(
                    $cookie->getName(),
                    $cookie->get(),
                    $expiration,
                    $cookie->getPath(),
                    $cookie->getDomain(),
                    $cookie->isSecure(),
                    $cookie->isHttpOnly()
                );
            }
        }
    }