def _SaveAuthentication(self):
    auth_file = self._AuthFilePath()
    try:
      dir = os.path.dirname(auth_file)
      if not os.path.exists(dir):
        os.makedirs(dir)
      fh = open(auth_file, 'w')
      fh.write(self._user_cookie)
      fh.close()
    except:
      logging.fatal('Failed to save authorization file %s', auth_file, exc_info=True)
      raise ScenarioLoginError('Error saving auth file for client %s.' % self.name)
Save the authorization cookie to a local file.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/watchdog/scenario.py/ScenarioDevice._SaveAuthentication