public void filter()

in integrations/shiro/shiro-authc/src/main/java/org/apache/aries/jax/rs/shiro/authc/impl/SecurityManagerAssociatingFilter.java [103:121]


    public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
            throws IOException {
        _LOG.debug("Cleaning up the Shiro Security Context");
        Subject subject = ThreadContext.getSubject();
        ThreadContext.unbindSecurityManager();
        ThreadContext.unbindSubject();
        
        if(subject != null && !subject.isAuthenticated()) {
            // Not authenticated. Check for incoming session cookie
            Cookie cookie = requestContext.getCookies().get(SESSION_COOKIE_NAME);
            
            // If we have a session cookie then it should be deleted
            if(cookie != null) {
                _LOG.debug("The subject associated with this request is not authenticated, removing the session cookie");
                responseContext.getHeaders().add(SET_COOKIE, getDeletionCookie(requestContext));
            }
        }
        
    }