Skip to content

Commit

Permalink
Implement hooking into the pipeline for create sid cookie (#452)
Browse files Browse the repository at this point in the history
It will improve creating sid cookie on the initial visit on the store
  • Loading branch information
Rayn93 authored May 22, 2023
1 parent 6edef7e commit 6a1bd3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/view/frontend/templates/ff/communication.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ $searchImmediate = $communicationParameters['search-immediate'] ?? 'false';
}

<?php if ($viewModel->isSsrEnable()): ?>
document.cookie = 'ffwebc_sid=' + factfinder.common.localStorage.getItem('ff_sid') + '; path=/;';
const eventAggregator = factfinder.communication.EventAggregator;
eventAggregator.addBeforeDispatchingCallback(function (event) {
document.cookie = 'ffwebc_sid=' + factfinder.common.localStorage.getItem('ff_sid') + '; path=/;';
});
<?php endif; ?>

if (<?= /** @SuppressWarnings(PHPMD) */ $searchImmediate ?>) {
Expand Down

0 comments on commit 6a1bd3f

Please sign in to comment.