Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log spam from Embed - Invalid cookie header - Invalid 'expires' attribute #2835

Open
HitmanInWis opened this issue Aug 8, 2024 · 1 comment

Comments

@HitmanInWis
Copy link

Bug Present as of Version: 2.25.5-SNAPSHOT

When using a twitter embed, logs get spammed with a bunch of warnings about invalid expires header on cookies.

08.08.2024 16:33:30.592 *WARN* [[0:0:0:0:0:0:0:1] [1723152810209] GET /content/mysite/embed-url/_jcr_content/root/container-bodywrapper/container/container/showcase/embed_623053893.urlProcessor.json HTTP/1.1] org.apache.http.client.protocol.ResponseProcessCookies Invalid cookie header: "set-cookie: guest_id_marketing=v1%3A172315281055025185; Max-Age=63072000; Expires=Sat, 08 Aug 2026 21:33:30 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None". Invalid 'expires' attribute: Sat, 08 Aug 2026 21:33:30 GMT
08.08.2024 16:33:30.592 *WARN* [[0:0:0:0:0:0:0:1] [1723152810209] GET /content/mysite/embed-url/_jcr_content/root/container-bodywrapper/container/container/showcase/embed_623053893.urlProcessor.json HTTP/1.1] org.apache.http.client.protocol.ResponseProcessCookies Invalid cookie header: "set-cookie: guest_id_ads=v1%3A172315281055025185; Max-Age=63072000; Expires=Sat, 08 Aug 2026 21:33:30 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None". Invalid 'expires' attribute: Sat, 08 Aug 2026 21:33:30 GMT
08.08.2024 16:33:30.592 *WARN* [[0:0:0:0:0:0:0:1] [1723152810209] GET /content/mysite/embed-url/_jcr_content/root/container-bodywrapper/container/container/showcase/embed_623053893.urlProcessor.json HTTP/1.1] org.apache.http.client.protocol.ResponseProcessCookies Invalid cookie header: "set-cookie: personalization_id="v1_rhyixvZDOy/LXsJArmPB6A=="; Max-Age=63072000; Expires=Sat, 08 Aug 2026 21:33:30 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None". Invalid 'expires' attribute: Sat, 08 Aug 2026 21:33:30 GMT
08.08.2024 16:33:30.592 *WARN* [[0:0:0:0:0:0:0:1] [1723152810209] GET /content/mysite/embed-url/_jcr_content/root/container-bodywrapper/container/container/showcase/embed_623053893.urlProcessor.json HTTP/1.1] org.apache.http.client.protocol.ResponseProcessCookies Invalid cookie header: "set-cookie: guest_id=v1%3A172315281055025185; Max-Age=63072000; Expires=Sat, 08 Aug 2026 21:33:30 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None". Invalid 'expires' attribute: Sat, 08 Aug 2026 21:33:30 GMT

Seems like a somewhat common issue: https://stackoverflow.com/questions/36473478/fixing-httpclient-warning-invalid-expires-attribute-using-fluent-api

Can fix this by updating com.adobe.cq.wcm.core.components.internal.services.embed.OEmbedClientImpl#getHttpClient

from

        RequestConfig rc = RequestConfig.custom()
            .setConnectTimeout(config.connectionTimeout())
            .setSocketTimeout(config.socketTimeout())
            .build();

to

        RequestConfig rc = RequestConfig.custom()
            .setConnectTimeout(config.connectionTimeout())
            .setSocketTimeout(config.socketTimeout())
            .setCookieSpec(CookieSpecs.STANDARD) // add this
            .build();
@HitmanInWis
Copy link
Author

A similar update should likely be made to com.adobe.cq.wcm.core.components.internal.form.FormHandlerImpl#activate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant