Update order attribution default cookie lifetime. (#41806)

This commit is contained in:
Bartosz Budzanowski 2023-11-30 22:53:59 +01:00 committed by GitHub
commit f271f9fea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: tweak
Change the default cookie lifetime from 6 months to the length of the session.

View File

@ -200,9 +200,11 @@ class OrderAttributionController implements RegisterHooksInterface {
*
* @since 8.5.0
*
* @param int $lifetime The lifetime of the cookie in months.
* @param float $lifetime The lifetime of the Sourcebuster cookies in months.
*
* The default value forces Sourcebuster into making the cookies valid for the current session only.
*/
$lifetime = (int) apply_filters( 'wc_order_attribution_cookie_lifetime_months', 6 );
$lifetime = (float) apply_filters( 'wc_order_attribution_cookie_lifetime_months', 0.00001 );
/**
* Filter the session length for source tracking.