Search in sources :

Example 1 with InvalidSessionException

use of org.openforis.collect.web.session.InvalidSessionException in project collect by openforis.

the class SessionListener method sessionDestroyed.

@Override
public void sessionDestroyed(HttpSessionEvent se) {
    SessionManager sessionManager = getSessionManager(se);
    try {
        SessionState sessionState = sessionManager.getSessionState();
        User user = null;
        if (sessionState != null) {
            user = sessionState.getUser();
            if (user != null) {
                sessionManager.sessionDestroyed();
            }
        }
        if (LOG.isInfoEnabled()) {
            String message = "Session destroyed: " + se.getSession().getId();
            if (user != null) {
                message += " username: " + user.getUsername();
            }
            LOG.info(message);
        }
    } catch (InvalidSessionException e) {
    // ignore it, session was anonymous
    }
}
Also used : InvalidSessionException(org.openforis.collect.web.session.InvalidSessionException) SessionState(org.openforis.collect.web.session.SessionState) User(org.openforis.collect.model.User) SessionManager(org.openforis.collect.manager.SessionManager)

Aggregations

SessionManager (org.openforis.collect.manager.SessionManager)1 User (org.openforis.collect.model.User)1 InvalidSessionException (org.openforis.collect.web.session.InvalidSessionException)1 SessionState (org.openforis.collect.web.session.SessionState)1