Save cookies to the file :attr:`.API.cookies_filename`
516135
def save_cookies(self, ignore_discard=True, ignore_expires=True):
        """"""
        if not isinstance(self.cookies, cookielib.FileCookieJar):
            m = 'Cookies must be a cookielib.FileCookieJar object to be saved.'
            raise APIError(m)
        self.cookies.save(ignore_discard=ignore_discard,
                          ignore_expires=ignore_expires)
556106
def write_cookies_to_cache(cj, username):
    
    mkdir_p(PATH_COOKIES, 0o700)
    path = get_cookies_cache_path(username)
    cached_cj = cookielib.MozillaCookieJar()
    for cookie in cj:
        cached_cj.set_cookie(cookie)
    cached_cj.save(path)
318166
def save_file(self, filename, text):
        """"""
        if not filename.endswith('.py'):
            filename += '.py'
        path = os.path.join(self.currentpath, filename)
        with open(path, 'w', encoding="utf-8") as file_:
            file_.write(text)
1120433
def save_to_file(self, fname):
        
        with open(fname, 'w') as f:
            f.write(str(self))
547202
def cookies(self) -> Dict[str, str]:
        """"""
        cookies = SimpleCookie()
        cookies.load(self.headers.get('Cookie', ''))
        return {key: cookie.value for key, cookie in cookies.items()}
1176243
def save(self, path):
        """"""
        to_save = {}
        for x in self.param_names:
            attr = self.__getattribute__(x)
            if type(attr) == np.ndarray:
                attr = [[float(x) for x in row] for row in attr]
            elif isinstance(attr, types.FunctionType):
                attr = attr.__name__
            to_save[x] = attr

        json.dump(to_save, open(path, 'w'))
1165664
def cookie_set(self, name, value):
		
		if not self.headers_active:
			raise RuntimeError('headers have already been ended')
		cookie = "{0}={1}; Path=/; HttpOnly".format(name, value)
		self.send_header('Set-Cookie', cookie)
1058382
def save(self):
        
        with open(self._filename, "w") as f:
            self.config.write(f)
298192
def savefig(self, filename, **kwargs):
        
        filename = os.path.expanduser(filename)
        kwargs.setdefault('show', False)
        kwargs.setdefault('save', filename)
        kwargs.setdefault('animate', False)
        return self._show_or_save(**kwargs)
290974
def _extract_cookies(self, response: Response):
        ''''''
        self._cookie_jar.extract_cookies(
            response, response.request, self._get_cookie_referrer_host()
        )
1260245
def store_to_file(self, filename):
    
    with tf.gfile.Open(filename, "w") as f:
      for i in range(len(self._id_to_token)):
        f.write(self._id_to_token[i] + "\n")
630429
def save(self):
        
        try:
            with open(self._filename, 'wb') as session_file:
                session_file.write(self.dumps())
        except IOError as error:
            LOGGER.error('Session file error: %s', error)
            raise error
1116007
function writeCookie (response, cookiePath) {
  try {
    debug('got response')
    var cookies = cookie.parse(response.headers['set-cookie'][0])
    debug('connect.sid', cookies['connect.sid'])
    fs.writeFileSync(cookiePath, JSON.stringify(cookies))
  } catch (e) {
    debug(e)
  }
}
114847
def save(self, filename, incl_uniqueid=False):
        
        filename = os.path.expanduser(filename)
        f = open(filename, 'w')
        json.dump(self.to_json(incl_uniqueid=incl_uniqueid), f,
                   sort_keys=True, indent=0, separators=(',', ': '))
        f.close()

        return filename
541494
def save(self, set_cookie, **params):
        """"""
        if set(self.store.items()) ^ set(self.items()):
            value = dict(self.items())
            value = json.dumps(value)
            value = self.encrypt(value)
            if not isinstance(value, str):
                value = value.encode(self.encoding)
            set_cookie(self.key, value, **self.params)
            return True
        return False
762508
def __addcookies(self):
        '''
        '''
        for cname, morsel in self.cookies.items():
            attrs = []
            value = morsel.get('version', '')
            if value != '' and value != '0':
                attrs.append('$Version=%s' % value)
            attrs.append('%s=%s' % (cname, morsel.coded_value))
            value = morsel.get('path')
            if value:
                attrs.append('$Path=%s' % value)
            value = morsel.get('domain')
            if value:
                attrs.append('$Domain=%s' % value)
            self.h.putheader('Cookie', "; ".join(attrs))
374383
def create_cookies(self, file, need_captcha=False, use_getpass=True):
        
        cookies_str = self.login_in_terminal(need_captcha, use_getpass)
        if cookies_str:
            with open(file, 'w') as f:
                f.write(cookies_str)
            print('cookies file created.')
        else:
            print('can\'t create cookies.')