• Noche70

    (@noche70)


    I have setup “remember me” and created a cookie “agegate” but every time I refresh the page, the gate shows up.

    I am trying to refresh the page after submitting yes, because the page navigation is based on scrolling, so if a visitor sees the gate but keeps scrolling, and then click on Yes to access the page, they might not be at the top, due to scrolling while on the gate. I dont see an option to disable scrolling, only to disable right click.

    I have the js code to refresh the page, but since the gate keeps showing up after every refresh, it creates a loop.

    How do I disable the gate after clicking ‘yes’? I have also disabled ‘Rechallenge’

    • This topic was modified 5 months ago by Noche70.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Noche70

    (@noche70)

    No cookie has been setup.

    Plugin Author Phil

    (@philsbury)

    Hi @noche70

    The scroll one is a little easier to work out and I don’t think you actually need a refresh on it;

    While default scroll is disabled your scrolljacking is still being picked up. But based on how that works, you can force it back to the top when age gate is passed by changing the hash like this:

    window.addEventListener('age_gate_passed', event => window.location.hash = 1);

    As for the cookie, the API response has set_cookie set to false. That only happens from a filter, so can you check your code for andything filtering age_gate/cookie/set?

    Thanks
    Phil

    Thread Starter Noche70

    (@noche70)

    Thank you Phil, the code for “age_gate_passed” worked like a charm, after clicking yes, it scrolls all the way to the top of the page.

    Regarding the cookie, I checked all my plugins and couldn’t find the culprit so I added define( 'COOKIE_DOMAIN', '.fruitwines.wpengine.com' ); to my wp-config, it did not work.

    I am contacting my hosting (WPengine) to see what’s going on, but question to you: do you have any plans for when Chrome phases out cookies?

    Plugin Author Phil

    (@philsbury)

    I’m fairly sure chrome is only going to be phasing out third-party cookies and as age gate sets it’s cookie directly from your site it classes as first party.

    That said – I think I’ve seen this on wpengine before. Age gate tries to set it’s cookie for all subdomains ant I think that might be being blocked.

    But, you can also use local storage rather than cookies at all, you can find that in Age Gate -> Advanced -> Local storage which should also fix the problem

    Thanks
    Phil

    Thread Starter Noche70

    (@noche70)

    WPengine cant find the cookie. I am using Chrome / Inspect / Application but cannot find my cookie, I gave it a custom name “age-gate” and set it to anonymous. I can exclude this from the cache.

    What should I look for? what’s the cookie’s name?

    • This reply was modified 5 months ago by Noche70.
    • This reply was modified 5 months ago by Noche70.
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.