public function protectedCookie(
        $name,
        $mode = self::COOKIE_DEFAULT
    ) {
        Types::assert(
            [
                'string|array' => [$name],
                'int' => [$mode]
            ]
        );

        if (is_string($name))
        {
            $name = strtolower($name);
        }
        elseif (is_array($name))
        {
            foreach ($name as $cookie)
            {
                $this->protectedCookie($cookie, $mode);
            }
            return;
        }

        $stringTypes = [];

        if (($mode & self::COOKIE_NAME) === self::COOKIE_NAME)
        {
            $stringTypes[] = 'names';
        }

        if (($mode & self::COOKIE_SUBSTR) === self::COOKIE_SUBSTR)
        {
            $stringTypes[] = 'substrings';
        }

        foreach ($stringTypes as $type)
        {
            if (
                ($mode & self::COOKIE_REMOVE) !== self::COOKIE_REMOVE
            and ! in_array($name, $this->protectedCookies[$type])
            ) {
                $this->protectedCookies[$type][] = $name;
            }
            elseif (
                ($mode & self::COOKIE_REMOVE) === self::COOKIE_REMOVE
                and (
                    $key = array_search(
                        $name,
                        $this->protectedCookies[$type]
                    )
                ) !== false
            ) {
                unset($this->protectedCookies[$type][$key]);
            }
        }
    }