• Resolved cleze

    (@cleze)


    The GDPR law says that if the user clicks on “Reject cookies” then since no cookies are collected, the banner can reappear during a next connection. Indeed, the user will be considered new due to the lack of a terminal identification process. But it seems that it’s doesn’t work with GDPR Cookie Consent plugin… ??

    How to fix this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @cleze,

    Our plugin saves the user consent in the plugin cookie named “viewed_cookie_policy” and it is saved for 365 days. Persistently showing the banner on every visit even after the user clicked reject once is not a recommended practice as it will affect the user experience of the site and some may even consider it as nagging to get the user to click accept.

    Let us know your thoughts.

    Thread Starter cleze

    (@cleze)

    Hi @webtoffee,

    Thanks for your answer ! ??
    I fully understand your reflection: myself as a user, it would annoy me to have to click “Reject” again on each visit.

    The request comes from a customer (an european bank) who tells me this: “Refusal or inaction should be treated the same. Upon refusal, the blindfold disappears. After 30 seconds, if there is no choice, the headband disappears as well. Since no cookie is collected, the banner may appear again the next time you log in. Indeed, the user will be considered new due to the lack of a terminal identification process.”

    Moreover, via your plugin, it is possible to make the banner disappear if the user does nothing, but this is considered as an acceptance of cookies. My client absolutely insists that this be considered as a refusal…
    Would it be possible to decide whether the disappearance of the banner constitutes acceptance or refusal?

    Plugin Author WebToffee

    (@webtoffee)

    Hi @cleze,

    Please add below code snippet to your site theme’s functions.php to set auto reject after delay.

    add_action('wp_head', 'cli_auto_reject');
    function cli_auto_reject() {
    	if (class_exists('Cookie_Law_Info')) {
    		?>
    			<script>
    				jQuery(function(){
    					//Set time in Milliseconds
    					var CLI_AUTO_REJECT_TIME = 10000;//10 Seconds
    					setTimeout(function(){
    						if(!CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) && CLI_AUTO_REJECT_TIME) {
    							CLI.reject_close();
    						}
    					},CLI_AUTO_REJECT_TIME);
    				});
    			</script>
    		<?php
    	}
    }

    To show the banner again after X days if rejected, please use below code.

    add_action('wp_footer','cli_set_expire',20);
    function cli_set_expire() { 
    	if(class_exists('Cookie_Law_Info_Public')) //first time visit and class exists
    	{
    	?>
    	<script type="text/javascript">
    		CLI_ACCEPT_COOKIE_EXPIRE = 365;//accept cookie expire after 365 days
    		var CLI_REJECT_COOKIE_EXPIRE_DAYS = 5;//cookie bar reappear after 5 days upon reject
    		jQuery(function() {
    			jQuery('.cli_action_button').click(function(e){
    				e.preventDefault();
    				if(jQuery(this).attr('data-cli_action') == 'reject') {
    					setTimeout(function() {
    						CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'no',CLI_REJECT_COOKIE_EXPIRE_DAYS);
    					}, 300);	
    				}
    			});
    		});	
    	</script>
    	<?php
    	}
    }

    Note : Please change the values of CLI_ACCEPT_COOKIE_EXPIRE & CLI_REJECT_COOKIE_EXPIRE_DAYS as per the need.

    Thread Starter cleze

    (@cleze)

    Thanks a lot for this code!

    I added it in functions.php and the banner disappears after 30 seconds but only if in the plugin administration, I click on the checkbox which allows to make the banner disappear after a certain delay (which is worth acceptance of cookies).

    But, it seems that it is the acceptance configured by default in the plugin that is actived because when I’m going to another page of the website, cookies are active as if the user had accepted them when he didn’t do anything and the banner just disappeared.

    Should I not check the option that allows to remove the banner in the plugin administration? When I made a test, the banner didn’t disappear at all…

    Thread Starter cleze

    (@cleze)

    Hi @webtoffee,

    I don’t know if you read my last message…
    Despite your code, Analytics cookies are still accepted when banner disappear.
    What can I do to have the banner disappear after 30 seconds and not be interpreted as user acceptance?

    Thanks

    Plugin Author WebToffee

    (@webtoffee)

    Hi @cleze,

    If you have the “Auto-hide(Accept) cookie bar after delay?” enabled, please turn it off for the code snippet to work correctly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Banner doesn’t reappear during a new connection after rejecting cookies’ is closed to new replies.