• Resolved hellu24

    (@hellu24)


    Hello!
    Is it possible to chnage the duration of viewed_cookie_policy. After plugin installation the duration of viewed_cookie_policy is 365 days. But I need this to be only 20 days.
    Thanks!!

Viewing 1 replies (of 1 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @hellu24,

    You may use the below code snippet to alter the viewed_cookie_policy expiration period.

    add_action('wp_footer','cli_set_expire_viewed_cookie',20);
    function cli_set_expire_viewed_cookie()
    { 
    	if(class_exists('Cookie_Law_Info_Public')) //Check class exists
    	{
    	?>
    	<script type="text/javascript">
    		
    		jQuery(document).ready(function(){	
    			jQuery('.cli_action_button').click(function(e){
    				jQuery.when(CLI_Cookie.set).then(function() {
    					currentvalue = CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME);
    					CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,currentvalue,20);	
    				});
    			});	
    		});
    		
    	</script>
    	<?php
    	}
    }

    If you like the plugin, leave us a review.

Viewing 1 replies (of 1 total)
  • The topic ‘Change duration of viewed_cookie_policy’ is closed to new replies.