Skip to content

Commit

Permalink
Merge pull request #32 from beatrycze-volk/fix-setcookie
Browse files Browse the repository at this point in the history
[BUGFIX] Fix calls to `setcookie`
  • Loading branch information
beatrycze-volk authored Oct 2, 2024
2 parents 8a0a680 + 4dc39b7 commit 8bd0509
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Classes/Controller/BasketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function initializeAction()
foreach ($documents as $document) {
$kitodoDocuments[] = $document->getRecordId();
}
setcookie('dlf-requests', json_encode($kitodoDocuments), '', '/');
setcookie('dlf-requests', json_encode($kitodoDocuments), 0, '/');
}
}

Expand Down Expand Up @@ -234,7 +234,7 @@ public function requestAction()
}
}

setcookie('dlf-requests', '[]', '', '/');
setcookie('dlf-requests', '[]', 0, '/');

$message = !empty($this->requestParams['message']) ? $this->requestParams['message'] : '';
$this->sendRequestAccessMail($documents, $message);
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/RedirectViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected static function setCookie(string $newKitodoRequestId) {
// add ID to cookie 'dlf-request' if ID is not already contained
if (!in_array($newKitodoRequestId, $kitodoRequestIds)) {
array_push($kitodoRequestIds, $newKitodoRequestId);
setcookie('dlf-requests', json_encode($kitodoRequestIds), '', '/');
setcookie('dlf-requests', json_encode($kitodoRequestIds), 0, '/');
}
}
}

0 comments on commit 8bd0509

Please sign in to comment.