private function sendRememberMeCookie(UserInterface $user, RememberMeCookie $cookie, Response $res)
    {
        // send the cookie with the same properties as the session cookie
        $sessionCookie = session_get_cookie_params();
        $res->setCookie($this->rememberMeCookieName(),
            $cookie->encode(),
            $cookie->getExpires(time()),
            $sessionCookie['path'],
            $sessionCookie['domain'],
            $sessionCookie['secure'],
            true);

        // save the cookie in the DB
        $cookie->persist($user);
    }