When the user session has timed out, "normal" user requests get automatically redirected to the login page and afterwards back to the actual request target.
This does not seem to work with the folding/unfolding mechanism of pagetree Macro. When the session has timed out and a user unfolds a hierarchy tree, the login page gets "included" into the current page at the position of the "+"-icon (see provided screenshot). This seems to be related to a background Ajax-request that is denied due to invalid session.