private function deriveCookiePathFromRequestUrl() {
        $path = $this->requestUrl->getPath();

        if ($path->get() == '' || substr((string)$path, 0, 1) != '/') {
            return '/';
        }
        
        if (substr_count((string)$path, '/') === 1) {
            return '/';
        }
        
        return substr((string)$path, 0, strrpos((string)$path, '/'));
    }