<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_session(self, user_agent, remote_address, client_version):
 """ Create a new session. :param str user_agent: Client user agent :param str remote_addr: Remote address of client :param str client_version: Remote client version :return: The new session id :rtype: int """


        self.session_counter += 1
        self.sessions[self.session_counter] = session = self.session_class()

        # Set session properties
        session.user_agent = user_agent
        session.remote_address = remote_address
        session.client_version = client_version

        # Invoke hooks
        invoke_hooks(self.hooks, "session_created", self.session_counter)

        return self.session_counter