In shiro multi-realm, is there any way to distinguish between login, authorization, and exit of two realm?

for example, the login and authorization operation to distinguish between the two realm has been implemented, but when logging out with subject.logout (), the authorization and login information of both realm will be cleared at the same time. What if you want to clear the login and authorization information of a realm separately.
it is worth mentioning that I read on the Internet that when shiro configuration is not specified, the sesssion obtained by the SecurityUtils.getSubject (). GetSession () of session,shiro is different from the session of sevlet. However, in my configuration, I was surprised to find that the session of shiro and the session of servlet in my project are the same. So, is it because of this reason that when subject.logout () exits, the two realm clear the authorization and login information at the same time?

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">
    <bean id="userRealm" class="com.test.shiro.realm.CustomUserRealm"></bean>
    <bean id="adminRealm" class="com.test.shiro.realm.CustomAdminRealm"></bean>
    <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
        <property name="authenticator" ref="authenticator"></property>
        <property name="realms">
            <list>
                <ref bean="adminRealm"/>
                <ref bean="userRealm"/>
            </list>
        </property>
    </bean>
    <bean id="authenticator" class="com.test.shiro.auth.CustomizedModularRealmAuthenticator">
         <property name="authenticationStrategy">
            <bean class="org.apache.shiro.authc.pam.FirstSuccessfulStrategy"></bean>
        </property>
    </bean>
    <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
    <!-- shrio -->
    <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="securityManager" ref="securityManager"/>
        <property name="filterChainDefinitions">
            <value>
                /static/** = anon
            </value>
        </property>
    </bean>
    <bean id="defaultAdvisorAutoProxyCreator" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
        <property name="proxyTargetClass" value="true"></property>
    </bean>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor"></bean>
</beans>

I just came into contact with shiro,. Some configurations are not very clear. Please take a look at them. For several days, there is no good solution

.
Jul.08,2021

No one, hey


RealmSecurityManager rsm = (RealmSecurityManager) SecurityUtils.getSecurityManager ();

    Collection<Realm> realms = rsm.getRealms();
    if (!CollectionUtils.isEmpty(realms)) {
        for (Realm realm : realms) {
            if (realm instanceof AuthorizingRealm) {
                ((AuthorizingRealm) realm).getAuthorizationCache().clear();
            }
        }
    }
Menu