Issue
This is my bean definition:
<bean id="securitySession"
name="securitySession,authorizer,authenticator,logAuditor"
class="com.ats_connection.webframework.core.security.SecuritySession"
scope="session"
destroy-method="logout">
<aop:scoped-proxy />
</bean>
But with scoped-proxy the logout method is not called.
If I don't use scoped-proxy destroy-method is called ok.
<bean id="asecProxy" class="com.ats_connection.webframework.core.security.AsecWSProxy" scope="session" destroy-method="destroy"/>
Solution
I found a solution using SessionListener. In the sessionDestroyed method:
securitySession = (SecuritySession) session.getAttribute("scopedTarget.securitySession");
securitySession.logout();
Note the key "scopedTarget.securitySession" instead of "securitySession".
Answered By - AguRamone
Answer Checked By - Candace Johnson (JavaFixing Volunteer)