public function getCode($set = true)
    {
        $list = $this->getList();
        $code = $this->getFromUrl();

        if (empty($code)) {
            $code = $this->getFromCookie();
        }

        if (empty($list[$code]['status'])) {
            $code = $this->getDefault();
        }

        if ($set) {
            $this->setCookie($code);
        }

        return $code;
    }