public function authenticate(Request $request, Response $response)
    {
        if (!isset($this->_registry->Cookie) || !$this->_registry->Cookie instanceof CookieComponent) {
            throw new \RuntimeException('You need to load the CookieComponent.');
        }

        $cookies = $this->_registry->Cookie->read($this->_config['cookie']['name']);
        if (empty($cookies)) {
            return false;
        }

        extract($this->_config['fields']);
        if (empty($cookies[$username]) || empty($cookies[$password])) {
            return false;
        }

        $user = $this->_findUser($cookies[$username], $cookies[$password]);
        if ($user) {
            return $user;
        }

        return false;
    }