Contao\Input::cookie PHP Method

    public static function cookie($strKey, $blnDecodeEntities = false)
    {
        if (!isset($_COOKIE[$strKey])) {
            return null;
        }
        $strCacheKey = $blnDecodeEntities ? 'cookieDecoded' : 'cookieEncoded';
        if (!isset(static::$arrCache[$strCacheKey][$strKey])) {
            $varValue = $_COOKIE[$strKey];
            $varValue = static::decodeEntities($varValue);
            $varValue = static::xssClean($varValue, true);
            $varValue = static::stripTags($varValue);
            if (!$blnDecodeEntities) {
                $varValue = static::encodeSpecialChars($varValue);
            }
            $varValue = static::encodeInsertTags($varValue);
            static::$arrCache[$strCacheKey][$strKey] = $varValue;
        }
        return static::$arrCache[$strCacheKey][$strKey];
    }

Usage Example

コード例 #1
0
ファイル: BackendUser.php プロジェクト: Mozan/core-bundle
 /**
  * Initialize the object
  */
 protected function __construct()
 {
     parent::__construct();
     $this->strIp = \Environment::get('ip');
     $this->strHash = \Input::cookie($this->strCookie);
 }
All Usage Examples Of Contao\Input::cookie