private function getStorage(ConfigObject $config = null)
    {
        if (!isset($this->storage)) {
            try {
                $driver = $config->get('Storage.Driver', NativeStorage::class);
                $this->storage = $this->factory($driver, CookieStorageInterface::class, [$config]);
            } catch (Exception $e) {
                throw new CookieException($e->getMessage());
            }
        }

        return $this->storage;
    }