code: def connect_user(self, username, realname, email, language):
          
  
          self._database.users.update_one({"email": email}, {"$set": {"realname": realname, "username": username, "language": language}},
                                          upsert=True)
          self._logger.info("User %s connected - %s - %s - %s", username, realname, email, web.ctx.ip)
          self._set_session(username, realname, email, language)
          return True
docs: Opens a session for the user
          :param username: Username
          :param realname: User real name
          :param email: User email