<?php 
$GLOBALS['TL_JAVASCRIPT'][] = \Contao\Config::get('uploadPath').'/cto_layout/scripts/cookie/jquery.cookie.js|static';
?>

<script>
// clear local storage
localStorage.removeItem('<?= $this->session_name; ?>');
// empty cookie
jQuery.removeCookie('<?= $this->session_name; ?>',{path:'/'});
// fire event
jQuery(document).trigger('Eclipse.clear_privacy_settings',{});
// log
console.log('Privacy settings cleared');
// redirect
<?php if($this->redirect): ?>
location.href = '<?= $this->redirect; ?>';
<?php endif; ?>

</script>