protected void doValidate(Session session) throws InvalidSessionException {
        if (session instanceof ValidatingSession) {
            ((ValidatingSession) session).validate();
        } else {
            String msg = "The " + getClass().getName() + " implementation only supports validating "
                    + "Session implementations of the " + ValidatingSession.class.getName() + " interface.  "
                    + "Please either implement this interface in your session implementation or override the "
                    + AbstractValidatingSessionManager.class.getName() + ".doValidate(Session) method to perform validation.";
            throw new IllegalStateException(msg);
        }
    }
Looks up a session from the underlying data store based on the specified session key.

@param key the session key to use to look up the target session.
@return the session identified by {@code sessionId}.
@throws UnknownSessionException if there is no session identified by {@code sessionId}.
core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java