Andrei Todorut Andrei Todorut - 1 month ago 16
PHP Question

$GLOBALS['TSFE']->fe_user->user null on 404 page

Why the user object is null on 404 pages ? The 404 page is set by

pageNotFound_handling
. Only on this page the user object is null .

Answer

This happens because TYPO3 requests the page in the background, without any session cookies set, so when rendering the 404 page, noone is logged in. TYPO3 then sends the result from that request to the client.

It can't send session cookies or something, since you could set any page in pageNotFound_handling, not just pages on the same domain.

I have no idea how to fix/circumvent it, but I'm interested in a solution too (especially since I use the same thing for 403 pages and more).

Comments