Set cookie expire as soon as user become affiliate through its link.

[ad_1]

Hey @kuschang,

This cannot be done out of the box, however, you can do this via custom code.

Here it is:

function slicewp_custom_remove_tracking_cookies_on_user_register() {
	
	if ( isset( $_COOKIE['slicewp_aff'] ) ) {
		unset( $_COOKIE['slicewp_aff'] );
		setcookie( 'slicewp_aff', '', time() - 3600 );
	}
	
	if ( isset( $_COOKIE['slicewp_visit'] ) ) {
		unset( $_COOKIE['slicewp_visit'] );
		setcookie( 'slicewp_visit', '', time() - 3600 );
	}
	
}
add_action( 'user_register', 'slicewp_custom_remove_tracking_cookies_on_user_register', 100 );

Please add the code to your website and try it out. The code will remove the tracking cookie upon user registration, if the tracking cookie exists.

Thank you and best wishes,

Mihai

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer