認証クッキーのサーバ側のファイルを保持するパスを返します。

@param	string	$cookie_name		認証クッキー名
@param	string	$cookie_save_dir	認証クッキー保存パス
186940
public static function CreateCookieSavePath ($cookie_name, $name = self::DEFAULT_CONNECTION_NAME) {
		return sprintf('%s/%s', rtrim(str_replace("\\", '/', static::GetAuthCookieSessionSavePath($name)), '/') , $cookie_name);
	}
153965
protected function CookieAuth ($name = CookieAuth::DEFAULT_CONNECTION_NAME) {
		if ($this->request->data->{static::$_cookieAuthForceLoginName}) {
			//強制再認証
			$user_name = $this->request->data->{static::$_cookieAuthIdName};
			$password = $this->request->data->{static::$_cookieAuthPasswordName};
			$this->removePostDataSet([static::$_cookieAuthIdName, static::$_cookieAuthPasswordName, $this->request->data->{static::$_cookieAuthForceLoginName}]);
		} else {
			$user_name	= null;
			$password	= null;
		}

		$result = CookieAuth::Auth($user_name, $password, $name);
		if ($result === CookieAuth::STATUS_UNAUTHORIZED) {
			static::CookieAuthNextAction();
			return false;
		}

		if ($result === CookieAuth::STATUS_FAILURE) {
			$this->setErrorList(['login' => [static::$_cookieAuthErrorMessage]]);
			static::CookieAuthNextAction();
			return false;
		}

		return $result;
	}
1275004
public function exists($cookie_name = null)
    {
        if (!empty($cookie_name)) {
            $this->setName($cookie_name);
        }
        return isset($_COOKIE[$this->getName()]);
    }
1308226
public void assertCookiePresentByName(final String cookieName) {
		Set<Cookie> cookies = driver.manage().getCookies();

		for (Cookie cookie : cookies) {
			if (cookie.getName().equals(cookieName)) {
				LOG.info("Cookie: " + cookieName + " was found with value: "
						+ cookie.getValue());
				Assert.assertEquals(cookieName, cookie.getName());
				return;
			}
		}
		Assert.fail("The given cookie name: " + cookieName
				+ " is not present within the current session!");
	}
1286177
public function storeCookies ($cookie_file)
	{
		//make sure all cookies are stored to $cookie_file when curl handle is closed
		curl_setopt($this->ch, CURLOPT_COOKIEJAR, $cookie_file);

		//The name of the file containing the cookie data
		curl_setopt($this->ch, CURLOPT_COOKIEFILE, $cookie_file);
	}
819872
protected function _SetCookie($CookieName, $KeyData, $CookieContents, $CookieExpires) {
      self::SetCookie($CookieName, $KeyData, $CookieContents, $CookieExpires, $this->CookiePath, $this->CookieDomain, $this->CookieHashMethod, $this->CookieSalt);
   }
878808
public function create_cookie($name, $value, $expiration=NULL, $path=NULL, $domain=NULL) {
		
		$expTime = NULL;
		if(!is_null($expiration)) {
			if(is_numeric($expiration)) {
				$expTime = $expiration;
			}
			elseif(preg_match('/ /', $expiration)) {
				$expTime = strtotime($expiration);
			}
			else {
				throw new exception(__METHOD__ .": invalid timestamp given (". $expiration .")");
			}
		}
		
		if(is_null($domain)) {
			$bits = explode('.', $_SERVER['SERVER_NAME']);
			if(count($bits) > 1) {
				$tldBit = $bits[count($bits)-1];
				$domBit  = $bits[count($bits)];
				$domain = '.'. $domBit .'.'. $tldBit;
			}
		}
		
		$retval = setcookie($name, $value, $expTime, $path, $domain);
		return($retval);
		
	}
873594
private function setCookieParams(array $cookie_params)
    {
        $params = array_merge(session_get_cookie_params(), array_change_key_case($cookie_params));

        session_set_cookie_params(
            $params['lifetime'],
            $params['path'],
            $params['domain'],
            $params['secure'],
            $params['httponly']
        );
    }
1290660
public function setSaveOptions($file_name = null, $directory = null, $suffix = null) {
		# Set Directory, or use Old if setted before from instance, or use img src directory
		if ($directory) {
			$this->_save_dir = rtrim($directory, DIRECTORY_SEPARATOR);
		} else if (!$this->_save_dir) {
			$this->_save_dir = $this->_image_info['dirname'];
		}

		// Check Directory
		if (!is_dir($directory)) {
			mkdir($directory, 0755, true);
		} else if (!is_writable($directory)) {
			chmod($directory, 0755);
		}

		# Set Filename
		if ($file_name) {
			$this->_save_name = basename($file_name, '.' . pathinfo($file_name, PATHINFO_EXTENSION)) . $suffix . '.' . $this->_output_format;
		} else if (!$this->_save_name) {
			$this->_save_name = $this->_image_info['filename'] . $suffix . '.' . $this->_output_format;
		}


		$this->_save_path = $this->_save_dir . DIRECTORY_SEPARATOR . $this->_save_name;

		return $this;
		# Method End
	}
424175
public static function CreateCookieName ($name = self::DEFAULT_CONNECTION_NAME) {
		$options = static::GetAuthCookieOptions($name);
		$cookie_save_dir	= $options['cookie_save_dir'];
		$cookie_name_prefix	= $options['cookie_name_prefix'];
		$cookie_name_safix	= $options['cookie_name_safix'];

		clearstatcache();
		for ($i = 0;$i < 100;$i++) {
			$cookie_name = sprintf('%s%s%s', $cookie_name_prefix, Hash::HmacString(rand(1, $i.microtime(true)).$cookie_name_prefix, rand(1, microtime(true)).$cookie_name_safix), $cookie_name_safix);
			if (!is_file(static::CreateCookieSavePath($cookie_name))) {
				return $cookie_name;
			}
		}

		return null;
	}
797664
public function cookie($name = '', $xss_clean = FALSE, $prefix='') {
		$cfg = Cfg::get('cookie');
		if ($prefix == '' and $cfg['prefix'] != '') {
			$prefix = $cfg['prefix'];
		}
		return $_COOKIE[$prefix.$name];
	}
1193551
public function open($save_path, $session_name)
    {
        $this->key = $this->getKey('KEY_' . $session_name);
        return parent::open($save_path, $session_name);
    }
1299756
public function save(
        $attach_dir,
        $filenameStrategy = Parser::ATTACHMENT_DUPLICATE_SUFFIX
    ) {
        $attach_dir = rtrim($attach_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
        if (!is_dir($attach_dir)) {
            mkdir($attach_dir);
        }

        // Determine filename
        switch ($filenameStrategy) {
            case Parser::ATTACHMENT_RANDOM_FILENAME:
                $attachment_path = tempnam($attach_dir, '');
                break;
            case Parser::ATTACHMENT_DUPLICATE_THROW:
            case Parser::ATTACHMENT_DUPLICATE_SUFFIX:
                $attachment_path = $attach_dir.$this->getFilename();
                break;
            default:
                throw new Exception('Invalid filename strategy argument provided.');
        }

        // Handle duplicate filename
        if (file_exists($attachment_path)) {
            switch ($filenameStrategy) {
                case Parser::ATTACHMENT_DUPLICATE_THROW:
                    throw new Exception('Could not create file for attachment: duplicate filename.');
                case Parser::ATTACHMENT_DUPLICATE_SUFFIX:
                    $attachment_path = $this->suffixFileName($attachment_path);
                    break;
            }
        }

        /** @var resource $fp */
        if ($fp = fopen($attachment_path, 'w')) {
            while ($bytes = $this->read()) {
                fwrite($fp, $bytes);
            }
            fclose($fp);
            return realpath($attachment_path);
        } else {
            throw new Exception('Could not write attachments. Your directory may be unwritable by PHP.');
        }
    }
861315
public function open($save_path, $name)
    {
        $this->_sessionSavePath = $save_path;
        $this->_sessionName     = $name;

        return true;
    }
876313
protected function _saveFile($url, $filename, $directory) {
		file_put_contents($directory.DIRECTORY_SEPARATOR.$filename, $this->_getCURL($url));
	}
1107207
public function store(Cookie $cookie) {
        $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
    }
251569
protected function _saveSessionCookie($sName, $sValue, $iExpire, $sPath, $sDomain)
    {
        if ($this->_mustSaveToSession()) {
            $aCookieData = ['value' => $sValue, 'expire' => $iExpire, 'path' => $sPath, 'domain' => $sDomain];

            $aSessionCookies = ( array ) \OxidEsales\Eshop\Core\Registry::getSession()->getVariable($this->_sSessionCookiesName);
            $aSessionCookies[$this->_getSessionCookieKey(false)][$sName] = $aCookieData;

            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable($this->_sSessionCookiesName, $aSessionCookies);
        }
    }