@Override
    public Optional<String> extract(final Authentication authentication, final HttpServletRequest request,
                                    final HttpServletResponse response) {
        val cookieValue = Optional.ofNullable(cookieGenerator.retrieveCookieValue(request))
            .orElseGet(() -> {
                val newFingerprint = createDeviceFingerPrintCookieValue().get();
                cookieGenerator.addCookie(request, response, newFingerprint);
                LOGGER.debug("Added device fingerprint cookie value [{}]", newFingerprint);
                return newFingerprint;
            });
        LOGGER.debug("Device fingerprint cookie value is [{}]", cookieValue);
        return Optional.of(cookieValue);
    }
{@link DeviceFingerprintExtractor} that sets/retrieves a
cookie from the request to track trusted devices.

@author Daniel Frett
@since 5.3.0
support/cas-server-support-trusted-mfa-core/src/main/java/org/apereo/cas/trusted/web/flow/fingerprint/CookieDeviceFingerprintExtractor.java