Commit 0f392b5c authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'B13842_wkthml_broken_sip' into 'develop'

B13842 Fix for broken SIP in wkhtml and qfqpdf. Now correct string will be set...

See merge request !413
parents b957a1d9 7e3728ce
Pipeline #6968 passed with stage
in 1 minute and 57 seconds
......@@ -71,10 +71,18 @@ 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.
// qfqpdf generates another cookie for pdf (SIPs then not reachable) if the given domain doesnt equal what is set in cookie params. Domain default from qfqpdf is without dot. We need to give the domain with previous dot.
$this->arrQfqPdfCookie[] = "name:$key,value:$value";
}
$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);
}
/**
......
......@@ -58,13 +58,14 @@ class Session
// Needed expire date for header() method
$expireDate = date("D, d-M-Y H:i:s", strtotime('+2 days')). ' GMT';
// More information about previous dots in domains: https://stackoverflow.com/questions/348282/php-cookie-domain-subdomain-control
if(PHP_VERSION_ID < 70300) {
session_set_cookie_params($lifetime, $path.';SameSite='.$samesite, $_SERVER['HTTP_HOST'], $secure, $httponly);
session_set_cookie_params($lifetime, $path.';SameSite='.$samesite, null, $secure, $httponly);
} else {
session_set_cookie_params([
'lifetime' => $lifetime,
'path' => $path,
'domain' => $_SERVER['HTTP_HOST'],
'domain' => null,
'secure' => $secure,
'httponly' => $httponly,
'samesite' => $samesite
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment