Issue Bug Closed

#93521Available cookies from previous request are lost, after being redirected to an error page by the PageContentErrorHandler

Kevin von Spiczak 02/16/21, 13:03 updated 11/08/26, 19:54

Description

We noticed that our frontend users were not logged in anymore, when reaching e.g. a 404 page.
In our SiteConfiguration we defined a couple errorHandler’s of type “Show Content from Page [Page]”, which is the PageContentErrorHandler.
We use this for:
  • 404
  • 403
  • 401
  • 500
  • 503

I managed to fix this by passing the cookies from the previous request with the CookieJar class from Guzzle. I attached the patch that we use in our codebase as .diff file.

Reviews 1

Files 1

History 811

  1. Gerrit Code Review pushed patch set 1 for master to change 67958 status Accepted Under Review <span data-processor="relativetime" data-value="2021-02-17T08:22:48+00:00" > 02/17/21, 08:22 </span>

  2. Oliver Hader commented and changed Tags pending-close <span data-processor="relativetime" data-value="2022-11-03T14:55:28+00:00" > 11/03/22, 14:55 </span>

    Change-set has been abandoned by author…

  3. Kevin von Spiczak commented <span data-processor="relativetime" data-value="2022-12-14T12:54:42+00:00" > 12/14/22, 12:54 </span>

    I just came back to this issue, since the latest changes (11.5.20) in the PageContentErrorHandler broke my patch.
    First I wanted to fix my patch, but then I noticed it is not needed anymore apparently. My fe_user cookie for instance is not lost anymore, when I reach a 404 page. Before I would login -> force a 404 page and on that page I could see in the navigation menu, that my account module is showing the “logged in state”, but the “logged out state”.

    Maybe someone else can verify this on their end too, then we can close this issue.

  4. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-08T19:54:29+00:00" > 11/08/26, 19:54 </span>

    Resolved: since TYPO3 v11.4 (#94402, opt-in) and by default since v12.0, the PageContentErrorHandler renders error pages from a page of the instance as an internal sub-request derived from the original request, so its cookies (and with it the frontend user session) are kept. Only error pages configured as external URLs are still fetched via HTTP, intentionally without forwarding cookies. Confirmed as not reproducible by the reporter and in comment #6. Closing.