code: public void checkCreateSessionForUser(CmsUser user) throws CmsException {
  
          if (getUserSessionMode() == UserSessionMode.single) {
              List<CmsSessionInfo> infos = getSessionInfos(user.getId());
              if (!infos.isEmpty()) {
                  throw new CmsCustomLoginException(
                      org.opencms.security.Messages.get().container(
                          org.opencms.security.Messages.ERR_ALREADY_LOGGED_IN_0));
              }
          }
  
      }
docs: Checks whether a new session can be created for the user, and throws an exception if not.<p>
  
  @param user the user to check
  @throws CmsException if no new session for the user can't be created