in src/main/java/org/apache/sling/jcr/base/internal/mount/ProxyJackrabbitRepository.java [40:53]
public Session login(Credentials credentials, String workspaceName, Map<String, Object> attributes) throws LoginException, NoSuchWorkspaceException, RepositoryException {
Session jcrSession = jcr.login(credentials, workspaceName, attributes);
if (attributes == null) {
attributes = new HashMap<>();
}
attributes.put(ProxyRepository.class.getPackage().getName() + ".PARENT_SESSION", jcrSession);
Session mountSession = mount.login(credentials, workspaceName, attributes);
return jcrSession instanceof JackrabbitSession ?
new ProxyJackrabbitSession(this, (JackrabbitSession) jcrSession, mountSession, this.mountPoints) :
new ProxySession<>(this, jcrSession, mountSession, this.mountPoints);
}