What is the role of `HttpServletRequest.getRemoteUser()` in user authentication?
It checks if the user is logged in and returns `null` if the user is not authenticated.
Thatâ€™s partially correct. While it returns the username, it doesn't check if the user is logged in directly.
Could you describe how authentication status is managed in a Java web application, and how `getRemoteUser()` fits into that?