Support » Plugin: EMC2 Popup Disclaimer » shows on every page load even after accepting

Viewing 4 replies - 1 through 4 (of 4 total)
  • ???

    I’m having the same issue. It’s not popping up on every single page but most of them. It seems to be worse in google chrome. I’m thinking it has something to do with the cookie setting in the plugin.

    I found the code for the cookie setting in the plugin at
    /js/jquery_cke.js

    Here’s the function for the cookie:

    (function($) {
        $.cookie = function(key, value, options) {
    
            // key and at least value given, set cookie...
            if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
                options = $.extend({}, options);
    
                if (value === null || value === undefined) {
                    options.expires = -1;
                }
    
                if (typeof options.expires === 'number') {
                    var days = options.expires, t = options.expires = new Date();
                    t.setDate(t.getDate() + days);
                }
    
                value = String(value);
    
                return (document.cookie = [
                    encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
                    options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
                    options.path    ? '; path=' + options.path : '',
                    options.domain  ? '; domain=' + options.domain : '',
                    options.secure  ? '; secure' : ''
                ].join(''));
            }
    
            // key and possibly options given, get cookie...
            options = value || {};
            var decode = options.raw ? function(s) { return s; } : decodeURIComponent;
    
            var pairs = document.cookie.split('; ');
            for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) {
                if (decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined
            }
            return null;
        };
    })(jQuery);

    Does anyone know how to configure this so the popup will only popup once per session after clicking on the Accept button?

    Thanks in advance.

    It’s not the cookie function that is in fault. In js\emc2pdc.js the code checks also for $force variable. I think if you use shortcodes in posts, then it’s forces the disclaimer to always show. Doesn’t make sense to me.
    Instead of
    if( ($j.cookie(’emc2pdc’) == ‘agreed’) && (!force) ){
    write
    if($j.cookie(’emc2pdc’) == ‘agreed’){

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘shows on every page load even after accepting’ is closed to new replies.