Merge pull request #24798 from woocommerce/fix/24792

Do not set tracking cookie on ajax requests
This commit is contained in:
Gerhard Potgieter 2019-11-18 14:00:21 +02:00 committed by GitHub
commit aaee28fe1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,11 @@ class WC_Tracks_Client {
* @return void
*/
public static function maybe_set_identity_cookie() {
// Do not set on AJAX requests.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return;
}
// Bail if cookie already set.
if ( isset( $_COOKIE['tk_ai'] ) ) {
return;