• Resolved kuschang

    (@kuschang)


    Hello @iovamihai

    Can we set the cookie expire as soon as a user registered successfully through that link?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    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

    Thread Starter kuschang

    (@kuschang)

    Okay, thanks a lot Mihai

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set cookie expire as soon as user become affiliate through its link.’ is closed to new replies.