Skip to content

Commit fc7cb9b

Browse files
committed
MAGE-891: default to 6 months for non authenticated users
1 parent 34c72fd commit fc7cb9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Helper/InsightsHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class InsightsHelper
2828
/** @var int */
2929
public const ALGOLIA_USER_TOKEN_MAX_LENGTH = 64;
3030

31+
/** @var int */
32+
public const ALGOLIA_USER_TOKEN_DEFAULT_LIFETIME = 15768000; // 6 months
33+
3134
/** @var string */
3235
public const QUOTE_ITEM_QUERY_PARAM = 'algoliasearch_query_param';
3336

@@ -165,7 +168,7 @@ public function setAuthenticatedUserToken(Customer $customer): string|null
165168
public function setNonAuthenticatedUserToken(): void
166169
{
167170
$metaData = $this->cookieMetadataFactory->createPublicCookieMetadata()
168-
->setDuration($this->configHelper->getCookieLifetime())
171+
->setDuration(InsightsHelper::ALGOLIA_USER_TOKEN_DEFAULT_LIFETIME)
169172
->setPath('/')
170173
->setHttpOnly(false)
171174
->setSecure(false);

0 commit comments

Comments
 (0)