docs: def getSession(self):
          """Return the existing session or a new session"""
          if self.session is not None:
              return self.session
  
          # Get value of cookie header that was sent
          cookie_str = self.headers.get('Cookie')
          if cookie_str:
              cookie_obj = SimpleCookie(cookie_str)
              sid_morsel = cookie_obj.get(self.SESSION_COOKIE_NAME, None)
              if sid_morsel is not None:
                  sid = sid_morsel.value
              else:
                  sid = None
          else:
              sid = None
  
          # If a session id was not set, create a new one
          if sid is None:
              sid = randomString(16, '0123456789abcdef')
              session = None
          else:
              session = self.server.sessions.get(sid)
  
          # If no session exists for this session ID, create one
          if session is None:
              session = self.server.sessions[sid] = {}
  
          session['id'] = sid
          self.session = session
          return session