• Hello,
    Is it possible to have the Age Gate ALWAYS on? I don’t want the site to remember the user at all. I want them to always be prompted. In fact, I’d be fine with NEVER setting the cookie so that (1) they are always prompted with the age gate (2) we don’t have to worry about GDPR.

    I tried setting “Remember Length = 0” but it still stored the cookie and let me past the gate upon my next visit.

    Thanks!
    Julie

    P.S. If it makes a difference, I only have 1 particular page on my site behind the age gate.

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

    (@philsbury)

    Hi @juliefox77,

    It will only remember them until they close/quit their browser – til the end of the session. Remember Length is only for the remember me box.

    There’s also a setting to use “Anonymous” age gate that only tracks if they’ve passed or not (in advanced settings).

    Saying all that, there’s essentially two options for you and they depend on your settings.

    If you have it in JavaScript mode, you can add this to your functions.php:

    add_filter('age_gate_set_cookie', '__return_false');

    That way the Age Gate will pass, but not set the cookie. A refresh should show the age gate again.

    If you are in standard, that won’t work as people would get stuck in an infinite Age Gate cycle, but it can be done, just a bit dirtier!

    Again in functions, you can add:

    add_action('template_include', function($template){
        $_COOKIE['age_gate'] = 0;
        setcookie('age_gate', 0, time() - 3600, COOKIEPATH, COOKIE_DOMAIN);
        return $template;
    
    }, 100);

    We essentially unset the cookie after it is set, but importantly, also after Age Gate has done it’s thing on checking the cookie.

    Should be able to take your pick there. Shout if anything doesn’t make sense.

    Thanks
    Phil

Viewing 1 replies (of 1 total)
  • The topic ‘Want to have age gate ALWAYS on’ is closed to new replies.