Register cookie jar.

@param string $cookiefile
970074
public function cookiejar($cookiefile)
    {
        $this->userOpt[CURLOPT_COOKIEFILE] = $cookiefile;
        $this->userOpt[CURLOPT_COOKIEJAR] = $cookiefile;
    }
1174612
public static function register(){
        ini_set('unserialize_callback_func', 'spl_autoload_call');
        spl_autoload_register(function($class){
            $cfile = strtr($class,'_\\','//') . '.php';
            foreach (static::$paths as $path => $v) {
                $file = rtrim($path,'/').'/'.$cfile;
                if(is_file($file)) return include($file);
            }
            return false;
        },false,true);
    }
1243276
public function setCookie(
        $cookie_key,
        $cookie_value,
        $expire = null,
        $path = null,
        $domain = null,
        $secure = null,
        $httpOnly = null
    )
    {
        $this->swooleResponse->cookie(
            $cookie_key,
            Lb::app()->encryptByConfig($cookie_value),
            $expire,
            $path,
            $domain,
            $secure,
            $httpOnly
        );
    }
22363
public function register()
	{
		$this->app->bindShared('cookie', function($app)
		{
			$config = $app['config']['session'];

			return with(new CookieJar)->setDefaultPathAndDomain($config['path'], $config['domain']);
		});
	}
281006
public function setCookie(
        $cookie_key,
        $cookie_value,
        $expire = null,
        $path = null,
        $domain = null,
        $secure = null,
        $httpOnly = null
    )
    {
        setcookie($cookie_key, Lb::app()->encryptByConfig($cookie_value), $expire, $path, $domain, $secure, $httpOnly);
    }
722118
protected function add_cookie($domain, $name, $value, $path = '/', $expires = 0)
    {
        $file = fopen($this->cookie_file, 'a');

        if (!$file) {
            $this->error = 603;
        } else {
            fwrite($file, $domain . '	TRUE	' . $path . '	FALSE	' . $expires . '	' . $name . '	' . $value . "\r\n");
            fclose($file);
        }
    }
152537
def _save_cookies(requests_cookiejar, filename):
    """"""
    with open(filename, 'wb') as handle:
        pickle.dump(requests_cookiejar, handle)
1141217
public static function registerHandlers($logFile = 'exception.log', $logDir = 'data/logs')
    {
        $logger = AbstractLogger::generateFileLogger($logFile, $logDir);

        Logger::registerExceptionHandler($logger->getLogger());
    }
1186789
public static function register()
    {
        if ( self::$hasBeenRegistered === true ) {
            return;
        }

        if ( stream_filter_register(self::getFilterName(), __CLASS__) === false ) {
            throw new RuntimeException('Failed to register stream filter: '.self::getFilterName());
        }

        self::$hasBeenRegistered = true;
    }
746137
protected function setCookie($cookieName, $cookieValue, $cookieTTL)
    {
        $cookieExpire = $this->currentTs + $cookieTTL;
        if (!headers_sent()) {
            setcookie(
                $this->getCookieName($cookieName),
                $cookieValue,
                $cookieExpire,
                $this->configCookiePath,
                $this->configCookieDomain
            );
        }
        return $this;
    }
863723
public static function registerHandlers($logFile = 'error.log', $logDir = 'data/logs')
    {
        $logger = new self($logFile, $logDir);
        self::registerErrorHandler($logger, true);
        self::registerExceptionHandler($logger);
    }
896088
def cookiejar(name='session'):
    
    log = logging.getLogger('ipsv.common.cookiejar')
    spath = os.path.join(config().get('Paths', 'Data'), '{n}.txt'.format(n=name))
    cj = cookielib.LWPCookieJar(spath)
    log.debug('Attempting to load session file: %s', spath)
    if os.path.exists(spath):
        try:
            cj.load()
            log.info('Successfully loaded a saved session / cookie file')
        except cookielib.LoadError as e:
            log.warn('Session / cookie file exists, but could not be loaded', exc_info=e)

    return cj
904120
public function clearCookieFile()
    {
        if (!is_writable($this->cookieFile)) {
            throw new CurlWrapperException('Cookie file "'.($this->cookieFile).'" is not writable or does\'n exists!');
        }

        file_put_contents($this->cookieFile, '', LOCK_EX);
    }
1284413
public function setCookieJar ($file) {
    if (null !== $file) {
      $this->addCurlOption(CURLOPT_COOKIEFILE, $file); //read from file
      $this->addCurlOption(CURLOPT_COOKIEJAR, $file); //write to file
    }
    return $this;
  }
1093212
public function setCookie(Cookie $cookie)
    {
        $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
    }
14035
private function registerLogViewer()
    {
        $this->singleton(Contracts\LogViewer::class, LogViewer::class);

        // Registering the Facade
        if ($facade = $this->config()->get('log-viewer.facade')) {
            $this->alias($facade, Facades\LogViewer::class);
        }
    }
908502
protected function empty_cookie_file()
    {
        $this->logged_in = false;

        if (file_exists($this->cookie_file)) {
            $f = fopen($this->cookie_file, 'w');
            fclose($f);
        }
    }