protected void cache(Session session, Serializable sessionId) {
        if (session == null || sessionId == null) {
            return;
        }
        Cache<Serializable, Session> cache = getActiveSessionsCacheLazy();
        if (cache == null) {
            return;
        }
        cache(session, sessionId, cache);
    }
Caches the specified session under the cache entry key of {@code sessionId}.

@param session   the session to cache
@param sessionId the session id, to be used as the cache entry key.
@since 1.0
core/src/main/java/org/apache/shiro/session/mgt/eis/CachingSessionDAO.java