5.10.6 Checking the login state (if the API is used)
The login state (whether users are logged in) can be determined by checking whether a Subject object is registered in HttpSession and whether there are users who are logged in the sessions of integrated user management.
<% Subject subject = (Subject)session.getAttribute("mySubject"); if(subject != null && LoginUtil.check(request, response, realm)){ // Processing performed if users are logged in } else { // Processing performed if no users are logged in } %>