This is a community ticket - this was a feature that previously was working, but then has been broken for several community releases.
var cmisConnection = cmis.getConnection();
var cmisSession = cmisConnection.getSession();
4.2.f and prior was functional, 5.0 forward now get ReferenceError: "cmis" is not defined
similar notes here: https://issues.alfresco.com/jira/browse/MNT-12795