Age Verification Landing Page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hi everyone,

I would like to put an age verification web before the landing page, but I don´t know how.

Can anyone help me?

Thank you very much.
10 years ago
Hi,

try to use the following script (put it to the _Root.cshtml):

<script type="text/javascript">
    var Cookie = new Object();
    Cookie.set = function(name, value, expires, path, domain, secure) {
        document.cookie = name + "=" + escape(value) +
            ((expires) ? "; expires=" + expires : "") +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            ((secure) ? "; secure" : "");
    };
    Cookie.get = function(name) {
        var prefix = name + "=";
        var cookieStartIndex = document.cookie.indexOf(prefix);
        if (cookieStartIndex == -1) return null;
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
        if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
    };
    Cookie.del = function(name, path, domain) {
        if (getCookie(name)) {
            document.cookie = name + "=" +
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                "; expires=Thu, 01-Jan-70 00:00:01 GMT";
        }
    };
    var cookieExists = null;
    cookieExists = Cookie.get("myStore");
    if (cookieExists != "1")
    {
        var areYouReady = confirm("You are 18 years old?");
        if (areYouReady) {
            Cookie.set("myStore", "1");
        }
        else { location.href = "javascript:history.back()"; }
    }
</script>
10 years ago
Hi Mariann,

I didn't realize you answered, so I will try your code this week and I will let you know if it worked correctly.

Thanks a lot for your help.
10 years ago
Hi again,

I have already tried it out and it works perfect!!!

Thanks a lot for your help.
5 years ago
Used this in 4.10. Works great thanks for Javascript.


<script type="text/javascript">
    var Cookie = new Object();
    Cookie.set = function(name, value, expires, path, domain, secure) {
        document.cookie = name + "=" + escape(value) +
            ((expires) ? "; expires=" + expires : "") +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            ((secure) ? "; secure" : "");
    };
    Cookie.get = function(name) {
        var prefix = name + "=";
        var cookieStartIndex = document.cookie.indexOf(prefix);
        if (cookieStartIndex == -1) return null;
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
        if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
    };
    Cookie.del = function(name, path, domain) {
        if (getCookie(name)) {
            document.cookie = name + "=" +
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                "; expires=Thu, 01-Jan-70 00:00:01 GMT";
        }
    };
    var cookieExists = null;
    cookieExists = Cookie.get("myStore");
    if (cookieExists != "1")
    {
        var areYouReady = confirm("You are 18 years old?");
        if (areYouReady) {
            Cookie.set("myStore", "1");
        }
        else { location.href = "javascript:history.back()"; }
    }
</script>[/quote]
3 years ago
This works,

but could this be done in a nice pop up, that could have some disclaimer and some information
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.