Cookies should only be set in wp-admin, avoid setting when doing ajax requests since that is seen as an admin request as well.

This commit is contained in:
Gerhard 2019-10-10 08:29:10 +02:00
parent badb135bd6
commit e22a024473
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;