[BUGFIX] Check for logged in user before showing cookie warning

If a redirect for login error is setup, the warning cookie
message is displayed instead of redirecting.

Resolves: #59493
Releases: 6.3, 6.2
Change-Id: I2f63b6630863ece0704198f247980c4d6c08f65a
Reviewed-on: https://review.typo3.org/30723
Reviewed-by: Oliver Hader
Reviewed-by: Marc Wöhlken
Tested-by: Marc Wöhlken
Reviewed-by: Markus Klein
Tested-by: Markus Klein