diff --git a/core/modules/user/src/PrivateTempStore.php b/core/modules/user/src/PrivateTempStore.php
index 651227c371..d4b5ea8dd6 100644
--- a/core/modules/user/src/PrivateTempStore.php
+++ b/core/modules/user/src/PrivateTempStore.php
@@ -207,7 +207,7 @@ protected function createkey($key) {
    *   The owner.
    */
   protected function getOwner() {
-    return $this->currentUser->id() ?: $this->requestStack->getCurrentRequest()->getSession()->getId();
+    return $this->currentUser->id() ? $this->requestStack->getCurrentRequest()->getSession()->getId() :"";
   }
 
 }
