code: def restore_session(self, cookie):
          
          log.debug("Restoring session from cookie: {}".format(cookie))
          opener = build_opener()
          opener.addheaders.append(('Cookie', cookie))
          self._opener = opener
docs: Establish databse connection using permanent session cookie