Example #1
0
 public function cookies()
 {
     $cookies_eu = Session::getCookie("cookies_eu");
     if (empty($cookies_eu)) {
         $cookies_eu = Session::setCookie("cookies_eu", "visible", 31556926);
     }
 }
Example #2
0
    /**
     * Loads up cookies if we haven't already done that
     *
     * @return void
     */
    public function load()
    {
        if (self::$loaded) {
            return;
        }

        self::$loaded  = true;
        self::$cookies = array();

        $namespace_length = strlen($this->context->getAddonName() . "__");

        foreach ($_COOKIE as $key => $value) {
            if (strpos($key, $this->context->getAddonName() . "__") === 0) {
                self::$cookies[substr($key, $namespace_length)] = Session::getCookie($key);
            }
        }
    }