diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index abb39f0747db7ac5391287762e66fb50cd6e1ee1..035c983426a7ef6919c1a7146feedbf5fdbc6048 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -195,7 +195,8 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c
     if (!filterCallback)
         return true;
 
-    bool thirdParty =
+    // Empty first-party URL indicates a first-party request (see net/base/static_cookie_policy.cc)
+    bool thirdParty = !firstPartyUrl.isEmpty() &&
             !net::registry_controlled_domains::SameDomainOrHost(toGurl(url),
                                                                 toGurl(firstPartyUrl),
                                                                 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);