diff --git a/extension/Classes/Core/Helper/SessionCookie.php b/extension/Classes/Core/Helper/SessionCookie.php
index 2de3eb2c699e1e989fa39d390c1dbc468e9051f3..80e62a9b394865e27460a9b99ae1e1b7b9b37b1f 100644
--- a/extension/Classes/Core/Helper/SessionCookie.php
+++ b/extension/Classes/Core/Helper/SessionCookie.php
@@ -71,10 +71,17 @@ class SessionCookie {
 
 //            $this->arrCookieString[] = "name:$key,value:$value,url:$domain,path:$path";
             // qfqpdf seems to have problems if 'domain' is specified: it hangs by fetching the website. Skip domain.
-            $this->arrQfqPdfCookie[] = "name:$key,value:$value";
+            $this->arrQfqPdfCookie[] = "name:$key,value:$value,domain:.$domain";
+        }
+        $linesForWkhtml = '';
+        for($i = 0; $i < count($wkhtml); $i++){
+            $linesForWkhtml .= $wkhtml[$i]['name'] . "=".$wkhtml[$i]['value']. "; domain=".$wkhtml[$i]['url']."; "."path=".$wkhtml[$i]['path'].";";
+            if($i+1 < count($wkhtml)){
+                $linesForWkhtml .= "\n";
+            }
         }
 
-        file_put_contents($this->pathFileNameCookie, json_encode(['cookies' => $wkhtml]), FILE_APPEND);
+        file_put_contents($this->pathFileNameCookie, $linesForWkhtml, FILE_APPEND);
     }
 
     /**